49
49
</t-input >
50
50
<t-image class =" captcha-wrapper" :src =" captchaImg" :style =" { height: '40px' }" @click =" refreshCaptcha" />
51
51
</t-form-item >
52
-
53
- <div class =" check-container remember-pwd" >
54
- <t-checkbox >记住账号</t-checkbox >
55
- <span class =" tip" >忘记账号?</span >
56
- </div >
57
52
</template >
58
53
59
54
<t-form-item v-if =" type !== 'qrcode'" class =" btn-container" >
60
- <t-button v-if =" disableLogin" block size =" large" theme =" default" :disabled =" disableLogin" > 账户已锁定 </t-button >
55
+ <t-button v-if =" disableLogin" block size =" large" theme =" default" :disabled =" disableLogin" > 账户已锁定, 请过会儿再试 </t-button >
61
56
<t-button v-else block size =" large" type =" submit" > 登录 </t-button >
62
57
</t-form-item >
63
58
@@ -73,6 +68,7 @@ import { useRouter } from 'vue-router';
73
68
import { FormInstanceFunctions , MessagePlugin } from ' tdesign-vue-next' ;
74
69
import { useUserStore } from ' @/store' ;
75
70
import { captcha , userStatus } from ' @/api/user' ;
71
+ import {BOOL } from " @/constants" ;
76
72
77
73
const userStore = useUserStore ();
78
74
@@ -119,6 +115,7 @@ const onSubmit = async ({ validateResult }) => {
119
115
if (e .response && e .response .data && e .response .data .message ) {
120
116
MessagePlugin .error (e .response .data .message );
121
117
}
118
+ await getUserStatus ();
122
119
await refreshCaptcha ();
123
120
}
124
121
}
@@ -129,12 +126,6 @@ const saveOldUsername = async () => {
129
126
};
130
127
131
128
const getUserStatus = async () => {
132
- if (oldUsername .value === formData .value .username ) {
133
- return ;
134
- }
135
- if (formData .value .username .length < 5 ) {
136
- return ;
137
- }
138
129
try {
139
130
const data = await userStatus ({ username: formData .value .username });
140
131
if (data .captcha ) {
@@ -148,7 +139,7 @@ const getUserStatus = async () => {
148
139
} else {
149
140
showCaptcha .value = false ;
150
141
}
151
- if (data .locked === ' 1 ' ) {
142
+ if (data .locked === BOOL . TRUE ) {
152
143
disableLogin .value = true ;
153
144
} else {
154
145
disableLogin .value = false ;
0 commit comments