|
|
|
@ -37,7 +37,6 @@
@@ -37,7 +37,6 @@
|
|
|
|
|
<img :src="codeUrl" @click="getCode" /> |
|
|
|
|
</ACol> |
|
|
|
|
</ARow> |
|
|
|
|
|
|
|
|
|
<ARow class="enter-x"> |
|
|
|
|
<ACol :span="12"> |
|
|
|
|
<FormItem> |
|
|
|
@ -56,14 +55,10 @@
@@ -56,14 +55,10 @@
|
|
|
|
|
</FormItem> |
|
|
|
|
</ACol> |
|
|
|
|
</ARow> |
|
|
|
|
|
|
|
|
|
<FormItem class="enter-x"> |
|
|
|
|
<Button type="primary" size="large" block @click="handleLogin" :loading="loading">{{ |
|
|
|
|
t('sys.login.loginButton') |
|
|
|
|
}}</Button> |
|
|
|
|
<!-- <Button size="large" class="mt-4 enter-x" block @click="handleRegister"> |
|
|
|
|
{{ t('sys.login.registerButton') }} |
|
|
|
|
</Button>--> |
|
|
|
|
</FormItem> |
|
|
|
|
<ARow class="enter-x"> |
|
|
|
|
<ACol :md="8" :xs="24"> |
|
|
|
@ -82,9 +77,7 @@
@@ -82,9 +77,7 @@
|
|
|
|
|
}}</Button> |
|
|
|
|
</ACol> |
|
|
|
|
</ARow> |
|
|
|
|
|
|
|
|
|
<Divider class="enter-x">{{ t('sys.login.otherSignIn') }}</Divider> |
|
|
|
|
|
|
|
|
|
<div class="flex justify-evenly enter-x" :class="`${prefixCls}-sign-in-way`"> |
|
|
|
|
<GithubFilled /> |
|
|
|
|
<WechatFilled /> |
|
|
|
@ -139,13 +132,17 @@
@@ -139,13 +132,17 @@
|
|
|
|
|
|
|
|
|
|
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN); |
|
|
|
|
|
|
|
|
|
async function getCode() { |
|
|
|
|
const codeModel = await getCaptcha(); |
|
|
|
|
codeUrl.value = codeModel.img ?? captchaDefImg; |
|
|
|
|
formData.realKey = codeModel.realKey; |
|
|
|
|
function getCode() { |
|
|
|
|
getCaptcha().then(codeModel =>{ |
|
|
|
|
codeUrl.value = codeModel.img ?? captchaDefImg; |
|
|
|
|
formData.realKey = codeModel.realKey; |
|
|
|
|
}).catch(() => { |
|
|
|
|
codeUrl.value = captchaDefImg; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async function handleLogin() { |
|
|
|
|
debugger |
|
|
|
|
const data = await validForm(); |
|
|
|
|
if (!data) return; |
|
|
|
|
try { |
|
|
|
@ -156,8 +153,6 @@
@@ -156,8 +153,6 @@
|
|
|
|
|
username: data.account, |
|
|
|
|
realKey: data.realKey, |
|
|
|
|
code: data.code, |
|
|
|
|
// 不要默认的错误提示 |
|
|
|
|
mode: 'none', |
|
|
|
|
}) |
|
|
|
|
); |
|
|
|
|
if (userInfo) { |
|
|
|
@ -167,12 +162,6 @@
@@ -167,12 +162,6 @@
|
|
|
|
|
duration: 3, |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} catch (error) { |
|
|
|
|
createErrorModal({ |
|
|
|
|
title: t('sys.api.errorTip'), |
|
|
|
|
content: String(error) || t('sys.api.networkExceptionMsg'), |
|
|
|
|
getContainer: () => document.body.querySelector(`.${prefixCls}`) || document.body, |
|
|
|
|
}); |
|
|
|
|
} finally { |
|
|
|
|
loading.value = false; |
|
|
|
|
} |
|
|
|
|