From 3ed2e2bdb32ec678c4b83542c7a762492e0c6cad Mon Sep 17 00:00:00 2001 From: X1627315083 <1627315083@qq.com> Date: Tue, 30 Sep 2025 10:49:01 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=BE=93=E5=85=A5=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E7=A0=81=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components.d.ts | 10 +--- src/component/LoginPage/login/personal.vue | 65 +++++++++++++++------ src/component/LoginPage/login/school.vue | 67 +++++++++++++++------- 3 files changed, 95 insertions(+), 47 deletions(-) diff --git a/components.d.ts b/components.d.ts index 74c7f549..a74ec2fa 100644 --- a/components.d.ts +++ b/components.d.ts @@ -9,28 +9,22 @@ export {} declare module 'vue' { export interface GlobalComponents { ABadge: typeof import('ant-design-vue/es')['Badge'] - ABreadcrumb: typeof import('ant-design-vue/es')['Breadcrumb'] ACheckbox: typeof import('ant-design-vue/es')['Checkbox'] - ADatePicker: typeof import('ant-design-vue/es')['DatePicker'] ADrawer: typeof import('ant-design-vue/es')['Drawer'] AImage: typeof import('ant-design-vue/es')['Image'] AInputNumber: typeof import('ant-design-vue/es')['InputNumber'] - AMenu: typeof import('ant-design-vue/es')['Menu'] - AMenuItem: typeof import('ant-design-vue/es')['MenuItem'] AModal: typeof import('ant-design-vue/es')['Modal'] + APagination: typeof import('ant-design-vue/es')['Pagination'] APopover: typeof import('ant-design-vue/es')['Popover'] ARangePicker: typeof import('ant-design-vue/es')['RangePicker'] ASelect: typeof import('ant-design-vue/es')['Select'] ASelectOption: typeof import('ant-design-vue/es')['SelectOption'] ASlider: typeof import('ant-design-vue/es')['Slider'] - ASpace: typeof import('ant-design-vue/es')['Space'] ASpin: typeof import('ant-design-vue/es')['Spin'] - ASubMenu: typeof import('ant-design-vue/es')['SubMenu'] ASwitch: typeof import('ant-design-vue/es')['Switch'] ATable: typeof import('ant-design-vue/es')['Table'] - ATabPane: typeof import('ant-design-vue/es')['TabPane'] - ATabs: typeof import('ant-design-vue/es')['Tabs'] AUpload: typeof import('ant-design-vue/es')['Upload'] + ElCascader: typeof import('element-plus/es')['ElCascader'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] } diff --git a/src/component/LoginPage/login/personal.vue b/src/component/LoginPage/login/personal.vue index 8afe7b59..21ae761b 100644 --- a/src/component/LoginPage/login/personal.vue +++ b/src/component/LoginPage/login/personal.vue @@ -68,6 +68,7 @@
We’ve sent an code to your email {{ email }}
@@ -97,7 +98,9 @@
Sign in
@@ -302,6 +305,8 @@ export default defineComponent({ passwordType: "password", userId: "", loginTime: true, + animation: false, + inputCodeTime: null as any, }; }, onBeforeUnmount() { @@ -413,6 +418,16 @@ export default defineComponent({ 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{ + this.submitEmailLogin(code) + } + + //提交验证码 return; } else { if (!this.password) { @@ -480,20 +495,23 @@ export default defineComponent({ //邮箱登录提交 submitEmailLogin(emailVerifyCode: any) { - let data = { - email: this.email, - emailVerifyCode: emailVerifyCode, - loginType: "EMAIL", - userId: this.userId, - }; - this.$emit('update:isMask',true) - Https.axiosPost(Https.httpUrls.accountLogin, data) - .then((rv: any) => { - this.setSuccessLogin(rv); - }) - .catch((res) => { - this.$emit('update:isMask',false) - }); + clearTimeout(this.inputCodeTime) + this.inputCodeTime = setTimeout(()=>{ + let data = { + email: this.email, + emailVerifyCode: emailVerifyCode, + loginType: "EMAIL", + userId: this.userId, + }; + this.$emit('update:isMask',true) + Https.axiosPost(Https.httpUrls.accountLogin, data) + .then((rv: any) => { + this.setSuccessLogin(rv); + }) + .catch((res) => { + this.$emit('update:isMask',false) + }); + },1000) }, isCheckAgreement() { message.info("Agree to all terms, privacy fees and policies"); @@ -602,7 +620,15 @@ export default defineComponent({ // } // ); // }, - }, + loginBtnMousedown(){ + this.animation = true + let mouseup = ()=>{ + this.animation = false + document.removeEventListener('mouseup',mouseup) + } + document.addEventListener('mouseup',mouseup) + }, +}, mounted() { }, }); @@ -763,13 +789,12 @@ export default defineComponent({ transition: all 0.3s; margin-top: 5rem; font-weight: 600; - + &.active{ + transform: scale(.9); + } &:hover { background: #3c3c3c; } - &[state="2"] { - cursor: not-allowed; - } } .NewAccount{ font-size: 1.6rem; @@ -778,6 +803,8 @@ export default defineComponent({ margin-top: 1.2rem; text-align: left; cursor: pointer; + width: min-content; + white-space: nowrap; } .segmentation{ margin-top: 4rem; diff --git a/src/component/LoginPage/login/school.vue b/src/component/LoginPage/login/school.vue index 60ca77d5..025290a7 100644 --- a/src/component/LoginPage/login/school.vue +++ b/src/component/LoginPage/login/school.vue @@ -90,6 +90,7 @@
We’ve sent an code to your email {{ email }}
@@ -121,9 +122,11 @@
-->
Sign in
@@ -302,6 +305,8 @@ export default defineComponent({ passwordType: "password", userId: "", loginTime: true, + animation: false, + inputCodeTime: null as any, }; }, onBeforeUnmount() { @@ -413,6 +418,16 @@ export default defineComponent({ 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{ + this.submitEmailLogin(code) + } + + //提交验证码 return; } else { if (!this.password) { @@ -481,21 +496,24 @@ export default defineComponent({ //邮箱登录提交 submitEmailLogin(emailVerifyCode: any) { - let data = { - email: this.email, - emailVerifyCode: emailVerifyCode, - loginType: "EMAIL", - userId: this.userId, - organizationName: this.selectSchool, - }; - this.$emit('update:isMask',true) - Https.axiosPost(Https.httpUrls.accountLogin, data) - .then((rv: any) => { - this.setSuccessLogin(rv); - }) - .catch((res) => { - this.$emit('update:isMask',false) - }); + clearTimeout(this.inputCodeTime) + this.inputCodeTime = setTimeout(()=>{ + let data = { + email: this.email, + emailVerifyCode: emailVerifyCode, + loginType: "EMAIL", + userId: this.userId, + organizationName: this.selectSchool, + }; + this.$emit('update:isMask',true) + Https.axiosPost(Https.httpUrls.accountLogin, data) + .then((rv: any) => { + this.setSuccessLogin(rv); + }) + .catch((res) => { + this.$emit('update:isMask',false) + }); + },1000) }, isCheckAgreement() { message.info("Agree to all terms, privacy fees and policies"); @@ -604,6 +622,14 @@ export default defineComponent({ // } // ); // }, + loginBtnMousedown(){ + this.animation = true + let mouseup = ()=>{ + this.animation = false + document.removeEventListener('mouseup',mouseup) + } + document.addEventListener('mouseup',mouseup) + }, }, mounted() { }, @@ -781,13 +807,12 @@ export default defineComponent({ transition: all 0.3s; margin-top: 5rem; font-weight: 600; - + &.active{ + transform: scale(.9); + } &:hover { background: #3c3c3c; } - &[state="2"] { - cursor: not-allowed; - } } .NewAccount{ font-size: 1.6rem; @@ -796,6 +821,8 @@ export default defineComponent({ margin-top: 1.2rem; text-align: left; cursor: pointer; + width: min-content; + white-space: nowrap; } .segmentation{ margin-top: 4rem;