diff --git a/src/component/LoginPage/login/enterprise.vue b/src/component/LoginPage/login/enterprise.vue index 7b7ce8da..278a90ea 100644 --- a/src/component/LoginPage/login/enterprise.vue +++ b/src/component/LoginPage/login/enterprise.vue @@ -193,10 +193,56 @@
Password
+
+
+
+ + +
+
At least 8 characters long
+
+
+
+ + +
+
Must contain special characters
+
+
+
+ + +
+
+ Mix of uppercase, lowercase and numbers +
+
+
@@ -302,6 +348,12 @@ export default defineComponent({ passwordType: "password", userId: "", loginTime: true, + passwordConditionShow:false, + passwordCondition: { + length: false, + special: false, + group: false, + }, }; }, onBeforeUnmount() { @@ -544,9 +596,26 @@ export default defineComponent({ sessionStorage.setItem("sessionId", randomNum); sessionStorage.setItem("record", JSON.stringify([])); } + }, + passwordInput(e) { + this.isPassword(this.newPassword); + }, + isPassword(password: any) { + this.passwordCondition.length = /.{8,}/.test(password); + this.passwordCondition.special = + /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(password); + this.passwordCondition.group = + /[a-z]/.test(password) && /[A-Z]/.test(password) && /\d/.test(password); + return Object.values(this.passwordCondition).filter( + (value) => value === true + ).length; }, //修改密码提交 submitResetPassword() { + if (this.isPassword(this.newPassword) < 3) { + message.info("You must satisfy ALL password conditions to register."); + return; + } let data = { email: this.forgetPasswordEmail, emailVerifyCode: this.forgetEmailValue, @@ -609,6 +678,36 @@ export default defineComponent({ .login_page { width: 100%; height: 100%; + .conditionShow { + bottom: 0; + position: absolute; + right: 0; + left: auto; + transform: translateY(-5rem); + background: #404040; + color: #fff; + font-size: 1.4rem; + padding: 2rem; + border-radius: 2rem; + z-index: 2; + > .item { + display: flex; + align-items: center; + margin-bottom: 0.5rem; + &:last-child { + margin-bottom: 0; + } + > .icon { + margin-right: 1rem; + i { + display: flex; + // &.fi-br-cross-small{ + // color: red; + // } + } + } + } + } .page_content { .login_content { margin: 0 auto; diff --git a/src/component/LoginPage/login/personal.vue b/src/component/LoginPage/login/personal.vue index 59c99a6d..7fc3cddb 100644 --- a/src/component/LoginPage/login/personal.vue +++ b/src/component/LoginPage/login/personal.vue @@ -189,10 +189,56 @@
Password
+
+
+
+ + +
+
At least 8 characters long
+
+
+
+ + +
+
Must contain special characters
+
+
+
+ + +
+
+ Mix of uppercase, lowercase and numbers +
+
+
@@ -258,6 +304,7 @@ import { useI18n } from "vue-i18n"; import { setLang } from "@/tool/guide"; import md5 from "md5"; import router from "@/router"; +import { pass } from "three/tsl"; export default defineComponent({ components: { VerificationCodeInput, @@ -307,6 +354,12 @@ export default defineComponent({ loginTime: true, animation: false, inputCodeTime: null as any, + passwordConditionShow:false, + passwordCondition: { + length: false, + special: false, + group: false, + }, }; }, onBeforeUnmount() { @@ -413,14 +466,12 @@ export default defineComponent({ checkRobot() { this.isCheckRobot = !this.isCheckRobot; }, - //提交账号密码预先登录 submitPerLogin() { //输入账号密码 if (this.emailStap >= 2) { let verificationCodeInputDom:any = this.$refs.verificationCodeInputDom let code = verificationCodeInputDom.getCtData.map(item => item).join(''); - console.log(code) if(code.length !== this.emailCode.length){ message.info("Please enter the complete verification code."); }else{ @@ -562,9 +613,26 @@ export default defineComponent({ sessionStorage.setItem("sessionId", randomNum); sessionStorage.setItem("record", JSON.stringify([])); } + }, + passwordInput(e) { + this.isPassword(this.newPassword); + }, + isPassword(password: any) { + this.passwordCondition.length = /.{8,}/.test(password); + this.passwordCondition.special = + /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(password); + this.passwordCondition.group = + /[a-z]/.test(password) && /[A-Z]/.test(password) && /\d/.test(password); + return Object.values(this.passwordCondition).filter( + (value) => value === true + ).length; }, //修改密码提交 submitResetPassword() { + if (this.isPassword(this.newPassword) < 3) { + message.info("You must satisfy ALL password conditions to register."); + return; + } let data = { email: this.forgetPasswordEmail, emailVerifyCode: this.forgetEmailValue, @@ -635,6 +703,36 @@ export default defineComponent({ .login_page { width: 100%; height: 100%; + .conditionShow { + bottom: 0; + position: absolute; + right: 0; + left: auto; + transform: translateY(-5rem); + background: #404040; + color: #fff; + font-size: 1.4rem; + padding: 2rem; + border-radius: 2rem; + z-index: 2; + > .item { + display: flex; + align-items: center; + margin-bottom: 0.5rem; + &:last-child { + margin-bottom: 0; + } + > .icon { + margin-right: 1rem; + i { + display: flex; + // &.fi-br-cross-small{ + // color: red; + // } + } + } + } + } .page_content { .login_content { margin: 0 auto; @@ -720,7 +818,6 @@ export default defineComponent({ cursor: pointer; } } - .login_form_input { width: 100%; height: 6.75rem; @@ -887,7 +984,7 @@ export default defineComponent({ .forget_passored_form_content { margin-top: 3.5rem; - + position: relative; .forget_passored_form_title { font-size: 2.4rem; font-weight: bold; diff --git a/src/component/LoginPage/login/school.vue b/src/component/LoginPage/login/school.vue index 3e5a4fe6..af38c27f 100644 --- a/src/component/LoginPage/login/school.vue +++ b/src/component/LoginPage/login/school.vue @@ -200,10 +200,56 @@
Password
+
+
+
+ + +
+
At least 8 characters long
+
+
+
+ + +
+
Must contain special characters
+
+
+
+ + +
+
+ Mix of uppercase, lowercase and numbers +
+
+
@@ -315,6 +361,12 @@ export default defineComponent({ loginTime: true, animation: false, inputCodeTime: null as any, + passwordConditionShow:false, + passwordCondition: { + length: false, + special: false, + group: false, + }, }; }, onBeforeUnmount() { @@ -572,9 +624,26 @@ export default defineComponent({ sessionStorage.setItem("sessionId", randomNum); sessionStorage.setItem("record", JSON.stringify([])); } + }, + passwordInput(e) { + this.isPassword(this.newPassword); + }, + isPassword(password: any) { + this.passwordCondition.length = /.{8,}/.test(password); + this.passwordCondition.special = + /[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/.test(password); + this.passwordCondition.group = + /[a-z]/.test(password) && /[A-Z]/.test(password) && /\d/.test(password); + return Object.values(this.passwordCondition).filter( + (value) => value === true + ).length; }, //修改密码提交 submitResetPassword() { + if (this.isPassword(this.newPassword) < 3) { + message.info("You must satisfy ALL password conditions to register."); + return; + } let data = { email: this.forgetPasswordEmail, emailVerifyCode: this.forgetEmailValue, @@ -645,6 +714,36 @@ export default defineComponent({ .login_page { width: 100%; height: 100%; + .conditionShow { + bottom: 0; + position: absolute; + right: 0; + left: auto; + transform: translateY(-5rem); + background: #404040; + color: #fff; + font-size: 1.4rem; + padding: 2rem; + border-radius: 2rem; + z-index: 2; + > .item { + display: flex; + align-items: center; + margin-bottom: 0.5rem; + &:last-child { + margin-bottom: 0; + } + > .icon { + margin-right: 1rem; + i { + display: flex; + // &.fi-br-cross-small{ + // color: red; + // } + } + } + } + } .page_content { .login_content { margin: 0 auto;