Skip to content

Commit e692367

Browse files
committed
[fix]bug
1 parent 47707f7 commit e692367

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed

src/api/model/userModel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface UserStatusReply {
2121
id: string;
2222
img: string;
2323
};
24-
locked: string;
24+
locked: boolean;
2525
lockExpire: string;
2626
}
2727

src/pages/login/components/Login.vue

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,10 @@
4949
</t-input>
5050
<t-image class="captcha-wrapper" :src="captchaImg" :style="{ height: '40px' }" @click="refreshCaptcha" />
5151
</t-form-item>
52-
53-
<div class="check-container remember-pwd">
54-
<t-checkbox>记住账号</t-checkbox>
55-
<span class="tip">忘记账号?</span>
56-
</div>
5752
</template>
5853

5954
<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>
6156
<t-button v-else block size="large" type="submit"> 登录 </t-button>
6257
</t-form-item>
6358

@@ -73,6 +68,7 @@ import { useRouter } from 'vue-router';
7368
import { FormInstanceFunctions, MessagePlugin } from 'tdesign-vue-next';
7469
import { useUserStore } from '@/store';
7570
import { captcha, userStatus } from '@/api/user';
71+
import {BOOL} from "@/constants";
7672
7773
const userStore = useUserStore();
7874
@@ -119,6 +115,7 @@ const onSubmit = async ({ validateResult }) => {
119115
if (e.response && e.response.data && e.response.data.message) {
120116
MessagePlugin.error(e.response.data.message);
121117
}
118+
await getUserStatus();
122119
await refreshCaptcha();
123120
}
124121
}
@@ -129,12 +126,6 @@ const saveOldUsername = async () => {
129126
};
130127
131128
const getUserStatus = async () => {
132-
if (oldUsername.value === formData.value.username) {
133-
return;
134-
}
135-
if (formData.value.username.length < 5) {
136-
return;
137-
}
138129
try {
139130
const data = await userStatus({ username: formData.value.username });
140131
if (data.captcha) {
@@ -148,7 +139,7 @@ const getUserStatus = async () => {
148139
} else {
149140
showCaptcha.value = false;
150141
}
151-
if (data.locked === '1') {
142+
if (data.locked === BOOL.TRUE) {
152143
disableLogin.value = true;
153144
} else {
154145
disableLogin.value = false;

src/pages/login/index.vue

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,14 @@
66
<div class="title-container">
77
<h1 class="title margin-no">登录到</h1>
88
<h1 class="title">TDesign Starter</h1>
9-
<div class="sub-title">
10-
<p class="tip">{{ type == 'register' ? '已有账号?' : '没有账号吗?' }}</p>
11-
<p class="tip" @click="switchType(type == 'register' ? 'login' : 'register')">
12-
{{ type == 'register' ? '登录' : '注册新账号' }}
13-
</p>
14-
</div>
159
</div>
1610

1711
<login v-if="type === 'login'" />
1812
<register v-else @register-success="switchType('login')" />
1913
<tdesign-setting />
2014
</div>
2115

22-
<footer class="copyright">Copyright @ 2021-2022 Tencent. All Rights Reserved</footer>
16+
<footer class="copyright">Copyright @ 2024 Go Cinch. All Rights Reserved</footer>
2317
</div>
2418
</template>
2519
<script lang="ts">

0 commit comments

Comments
 (0)