diff --git a/fir_client/src/components/FirLogin.vue b/fir_client/src/components/FirLogin.vue index a10b926..d01f3ac 100644 --- a/fir_client/src/components/FirLogin.vue +++ b/fir_client/src/components/FirLogin.vue @@ -16,9 +16,21 @@ - - - + + + + + + + + + + + + + 6) { loginFun(data => { if (data.code == 1000) { @@ -115,7 +158,8 @@ "username": email, "password": password, "authcode": authcode, - "cptch_key": this.cptch.cptch_key + "cptch_key": this.cptch.cptch_key, + "login_type": login_type, } }); @@ -136,16 +180,31 @@ onRegister() { this.$router.push({name: 'FirRegist'}) }, - isEmail(input) { - if (input.match(/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/)) { - return true; + set_activename() { + if (this.allow_ways.up) { + this.activeName = 'username'; + } else { + this.activeName = 'smsemail'; + } + }, + set_rtitle() { + this.rutitle = ''; + if (this.allow_ways.sms) { + this.rutitle = this.rutitle + '手机号 '; } - return false; + if (this.allow_ways.email) { + this.rutitle = this.rutitle + '邮箱 '; + } + + this.rutitle = this.rutitle.trim().replace(' ', '或'); }, get_auth_code() { loginFun(data => { - if (data.code == 1000) { + if (data.code === 1000) { this.cptch = data.data; + this.allow_ways = data.data.login_type; + this.set_rtitle(); + this.set_activename(); } else { this.$message({ message: data.msg, diff --git a/fir_client/src/components/FirRegist.vue b/fir_client/src/components/FirRegist.vue index c716b7b..fcf03c6 100644 --- a/fir_client/src/components/FirRegist.vue +++ b/fir_client/src/components/FirRegist.vue @@ -26,11 +26,10 @@ clearable> - - + { - if (data.code == 1000) { + if (data.code === 1000) { let jdata = data.data; if (jdata.enable) { this.allow_r = true; - this.allow_ways = jdata.ways; + this.allow_ways = jdata.register_type; this.set_rtitle(); this.cptch = data.data; } else { @@ -151,7 +148,7 @@ }); }, getphonecode() { - let act = 'ways'; + let act = 'up'; if (!this.docheck()) { return } @@ -244,7 +241,7 @@ if (authcode.length === this.cptch.length) { if (password === password2 && password.length >= 6) { registerFun(data => { - if (data.code == 1000) { + if (data.code === 1000) { this.$message({ message: '注册成功', type: 'success' @@ -286,12 +283,12 @@ onLogin() { this.$router.push({name: 'FirLogin'}) }, - isEmail(input) { - if (input.match(/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/)) { - return true; - } - return false; - } + // isEmail(input) { + // if (input.match(/^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/)) { + // return true; + // } + // return false; + // } } , created() { diff --git a/fir_client/src/components/FirUserProfileInfo.vue b/fir_client/src/components/FirUserProfileInfo.vue index 7d8df55..d969dea 100644 --- a/fir_client/src/components/FirUserProfileInfo.vue +++ b/fir_client/src/components/FirUserProfileInfo.vue @@ -2,51 +2,61 @@
- - - - - - - - + + - + - - + 保存 + + - + - + - - + 保存 + + + + + + + + + + + + 获取验证码 + @@ -54,15 +64,15 @@ - + - + - - + 保存 @@ -70,14 +80,30 @@ - + + + + + + + + + + + + + + - - 获取验证码 @@ -86,6 +112,48 @@ + + + + + + + + + + + + + 保存 + + + + + + + + + + + + + + + + + 保存 + + + + + + + @@ -93,7 +161,7 @@