|
|
|
@ -132,13 +132,14 @@
@@ -132,13 +132,14 @@
|
|
|
|
|
|
|
|
|
|
const getShow = computed(() => unref(getLoginState) === LoginStateEnum.LOGIN); |
|
|
|
|
|
|
|
|
|
function getCode() { |
|
|
|
|
getCaptcha().then(codeModel =>{ |
|
|
|
|
async function getCode() { |
|
|
|
|
try { |
|
|
|
|
const codeModel = await getCaptcha(); |
|
|
|
|
codeUrl.value = codeModel.img ?? captchaDefImg; |
|
|
|
|
formData.realKey = codeModel.realKey; |
|
|
|
|
}).catch(() => { |
|
|
|
|
} catch(error) { |
|
|
|
|
codeUrl.value = captchaDefImg; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
async function handleLogin() { |
|
|
|
@ -146,14 +147,12 @@
@@ -146,14 +147,12 @@
|
|
|
|
|
if (!data) return; |
|
|
|
|
try { |
|
|
|
|
loading.value = true; |
|
|
|
|
const userInfo = await userStore.login( |
|
|
|
|
toRaw({ |
|
|
|
|
const userInfo = await userStore.login(toRaw({ |
|
|
|
|
password: data.password, |
|
|
|
|
username: data.account, |
|
|
|
|
realKey: data.realKey, |
|
|
|
|
code: data.code, |
|
|
|
|
}) |
|
|
|
|
); |
|
|
|
|
})); |
|
|
|
|
if (userInfo) { |
|
|
|
|
notification.success({ |
|
|
|
|
message: t('sys.login.loginSuccessTitle'), |
|
|
|
|