Skip to content

Commit 51cffa4

Browse files
committed
【功能优化】登录界面,如果禁用验证码,不初始化 Verify 组件
1 parent e985b25 commit 51cffa4

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

src/api/login/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export const socialAuthRedirect = (type: number, redirectUri: string) => {
7777
}
7878
// 获取验证图片以及 token
7979
export const getCode = (data) => {
80+
debugger
8081
return request.postOriginal({ url: 'system/captcha/get', data })
8182
}
8283

src/views/Login/SocialLogin.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@
133133
</el-form-item>
134134
</el-col>
135135
<Verify
136+
v-if="loginData.captchaEnable === 'true'"
136137
ref="verify"
137138
:captchaType="captchaType"
138139
:imgSize="{ width: '400px', height: '200px' }"

src/views/Login/components/LoginForm.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
</el-form-item>
7777
</el-col>
7878
<Verify
79+
v-if="loginData.captchaEnable === 'true'"
7980
ref="verify"
8081
:captchaType="captchaType"
8182
:imgSize="{ width: '400px', height: '200px' }"
@@ -241,7 +242,7 @@ const getTenantByWebsite = async () => {
241242
}
242243
const loading = ref() // ElLoading.service 返回的实例
243244
// 登录
244-
const handleLogin = async (params) => {
245+
const handleLogin = async (params: any) => {
245246
loginLoading.value = true
246247
try {
247248
await getTenantId()
@@ -273,7 +274,7 @@ const handleLogin = async (params) => {
273274
if (redirect.value.indexOf('sso') !== -1) {
274275
window.location.href = window.location.href.replace('/login?redirect=', '')
275276
} else {
276-
push({ path: redirect.value || permissionStore.addRouters[0].path })
277+
await push({ path: redirect.value || permissionStore.addRouters[0].path })
277278
}
278279
} finally {
279280
loginLoading.value = false
@@ -313,8 +314,7 @@ const doSocialLogin = async (type: number) => {
313314
encodeURIComponent(`type=${type}&redirect=${redirect.value || '/'}`)
314315
315316
// 进行跳转
316-
const res = await LoginApi.socialAuthRedirect(type, encodeURIComponent(redirectUri))
317-
window.location.href = res
317+
window.location.href = await LoginApi.socialAuthRedirect(type, encodeURIComponent(redirectUri))
318318
}
319319
}
320320
watch(

src/views/Login/components/RegisterForm.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
</el-form-item>
8686
</el-col>
8787
<Verify
88+
v-if="registerData.captchaEnable === 'true'"
8889
ref="verify"
8990
:captchaType="captchaType"
9091
:imgSize="{ width: '400px', height: '200px' }"

0 commit comments

Comments
 (0)