|
@@ -110,6 +110,20 @@
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="verificationCode-box">
|
|
|
|
+ <input
|
|
|
|
+ type="text"
|
|
|
|
+ :class="'input'"
|
|
|
|
+ :placeholder="'邮箱验证码'"
|
|
|
|
+ v-model="emailCode"
|
|
|
|
+ @input="ChangeVericationCode"
|
|
|
|
+ maxlength="20"
|
|
|
|
+ />
|
|
|
|
+ <div class="verificationCode-btn" @click="getVerificationCode"
|
|
|
|
+ :class="VerificationCodeShow ? 'waitTime' : 'getVerification'">
|
|
|
|
+ {{ VerificationCodeShow ? time+'s' : $t("Key93") }}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
</template>
|
|
</template>
|
|
<!-- 验证码登录 v-show="loginType == '验证码'"
|
|
<!-- 验证码登录 v-show="loginType == '验证码'"
|
|
-->
|
|
-->
|
|
@@ -211,7 +225,7 @@ import { setI18nLang } from "@/utils/i18n";
|
|
export default {
|
|
export default {
|
|
//import引入的组件需要注入到对象中才能使用
|
|
//import引入的组件需要注入到对象中才能使用
|
|
components: { UserAgreement },
|
|
components: { UserAgreement },
|
|
- props: ["ForgetType", "changeLoginReg", "changeLoginType", "getChildSysList"],
|
|
|
|
|
|
+ props: ["ForgetType", "changeLoginReg", "changeLoginType", "getChildSysList","changeEmailTips"],
|
|
data() {
|
|
data() {
|
|
//这里存放数据
|
|
//这里存放数据
|
|
return {
|
|
return {
|
|
@@ -233,6 +247,8 @@ export default {
|
|
verificationCodeimg: "", // 图形验证码
|
|
verificationCodeimg: "", // 图形验证码
|
|
verificationCodeimgID: "", // 图形验证码ID
|
|
verificationCodeimgID: "", // 图形验证码ID
|
|
verificationCodeLoading: true, // 图形验证码的flag
|
|
verificationCodeLoading: true, // 图形验证码的flag
|
|
|
|
+ time: 60, //获取验证码的时间
|
|
|
|
+ emailCode: ""
|
|
};
|
|
};
|
|
},
|
|
},
|
|
//计算属性 类似于data概念
|
|
//计算属性 类似于data概念
|
|
@@ -261,6 +277,7 @@ export default {
|
|
},
|
|
},
|
|
ChangeVericationCode() {
|
|
ChangeVericationCode() {
|
|
this.verificationCode = this.verificationCode.trim();
|
|
this.verificationCode = this.verificationCode.trim();
|
|
|
|
+ this.emailCode = this.emailCode.trim()
|
|
},
|
|
},
|
|
//选择密码登录和验证码登录
|
|
//选择密码登录和验证码登录
|
|
selectLoginType(type) {
|
|
selectLoginType(type) {
|
|
@@ -279,7 +296,37 @@ export default {
|
|
},
|
|
},
|
|
// 获取验证码
|
|
// 获取验证码
|
|
getVerificationCode() {
|
|
getVerificationCode() {
|
|
- this.VerificationCodeShow = true;
|
|
|
|
|
|
+ let this_ = this;
|
|
|
|
+ if(this_.time != 60){
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ let timer;
|
|
|
|
+ if (this_.email_phone) {
|
|
|
|
+ this_.VerificationCodeShow = true;
|
|
|
|
+ timer = setInterval(() => {
|
|
|
|
+ this_.time--;
|
|
|
|
+ if (this_.time == 0) {
|
|
|
|
+ this_.VerificationCodeShow = false;
|
|
|
|
+ clearInterval(timer);
|
|
|
|
+ timer = null;
|
|
|
|
+ this_.time = 60;
|
|
|
|
+ }
|
|
|
|
+ }, 1000);
|
|
|
|
+ let MethodName = "user_manager-SendVerificationCode";
|
|
|
|
+ let data = {
|
|
|
|
+ verification_type: 'EMAIL',
|
|
|
|
+ phone_or_email: this_.email_phone,
|
|
|
|
+ };
|
|
|
|
+ getLogin(MethodName, data).then((res) => {
|
|
|
|
+ }).catch(()=>{
|
|
|
|
+ this_.VerificationCodeShow = false;
|
|
|
|
+ clearInterval(timer);
|
|
|
|
+ timer = null;
|
|
|
|
+ this_.time = 60;
|
|
|
|
+ });
|
|
|
|
+ } else {
|
|
|
|
+ this_.$message.warning(this.$t("Key546"));
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 登录
|
|
// 登录
|
|
gotoLogin() {
|
|
gotoLogin() {
|
|
@@ -315,6 +362,9 @@ export default {
|
|
password: md5(this.password).toUpperCase(),
|
|
password: md5(this.password).toUpperCase(),
|
|
verification_code_image_text: this.verificationCode,
|
|
verification_code_image_text: this.verificationCode,
|
|
verification_code_image_id: this.verificationCodeimgID,
|
|
verification_code_image_id: this.verificationCodeimgID,
|
|
|
|
+ dynamic_verification_type:'EMAIL',
|
|
|
|
+ phone_or_email: this.email_phone,
|
|
|
|
+ dynamic_verification_code: this.emailCode
|
|
};
|
|
};
|
|
if (this.rememberMe) {
|
|
if (this.rememberMe) {
|
|
} else {
|
|
} else {
|
|
@@ -322,28 +372,36 @@ export default {
|
|
}
|
|
}
|
|
getLogin(MethodName, data)
|
|
getLogin(MethodName, data)
|
|
.then((res) => {
|
|
.then((res) => {
|
|
- this.$message.success(this.$t("Key442"));
|
|
|
|
- this.changeLoginReg("", res);
|
|
|
|
this.isLogin = false;
|
|
this.isLogin = false;
|
|
|
|
+ if(res.status==-5){
|
|
|
|
+ this.$message.error(res.error);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ this.changeLoginReg("", res);
|
|
if (this.rememberMe) {
|
|
if (this.rememberMe) {
|
|
let obj = {
|
|
let obj = {
|
|
- email_phone: this.email_phone,
|
|
|
|
- user_type: res.user_type,
|
|
|
|
|
|
+ email_phone: this.email_phone,
|
|
|
|
+ user_type: res.user_type,
|
|
};
|
|
};
|
|
localStorage.setItem("user_name", JSON.stringify(obj));
|
|
localStorage.setItem("user_name", JSON.stringify(obj));
|
|
}
|
|
}
|
|
- setToken(res);
|
|
|
|
- setI18nLang(this.language_type).then(() => {
|
|
|
|
- if (
|
|
|
|
- res.popedom_code_list.indexOf(2000001) > -1 ||
|
|
|
|
- res.user_type == "STUDENT"
|
|
|
|
- ) {
|
|
|
|
- this.$message.warning(this.$t("Key247") + "....");
|
|
|
|
- location.href = `/GCLS-Learn/#/EnterSys`;
|
|
|
|
- } else {
|
|
|
|
- this.getChildSysList();
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ setToken(res);
|
|
|
|
+ if(res.last_update_password_days>=res.sys_recommend_password_update_days){
|
|
|
|
+ this.changeEmailTips(res.last_update_password_days)
|
|
|
|
+ }else{
|
|
|
|
+ this.$message.success(this.$t("Key442"));
|
|
|
|
+ setI18nLang(this.language_type).then(() => {
|
|
|
|
+ if (
|
|
|
|
+ res.popedom_code_list.indexOf(2000001) > -1 ||
|
|
|
|
+ res.user_type == "STUDENT"
|
|
|
|
+ ) {
|
|
|
|
+ this.$message.warning(this.$t("Key247") + "....");
|
|
|
|
+ location.href = `/GCLS-Learn/#/EnterSys`;
|
|
|
|
+ } else {
|
|
|
|
+ this.getChildSysList();
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
})
|
|
})
|
|
.catch((err) => {
|
|
.catch((err) => {
|
|
this.isLogin = false;
|
|
this.isLogin = false;
|
|
@@ -563,6 +621,23 @@ export default {
|
|
cursor: pointer;
|
|
cursor: pointer;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ &.verificationCode-btn{
|
|
|
|
+ width: 128px;
|
|
|
|
+ margin-left: 5px;
|
|
|
|
+ background: #FF9900;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ color: #fff;
|
|
|
|
+ font-weight: 700;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ &.waitTime{
|
|
|
|
+ background: #F0F0F0;
|
|
|
|
+ color: #6C6C6C;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|