fix: 登录验证异常
This commit is contained in:
@@ -98,16 +98,16 @@
|
||||
errorShow.value = true;
|
||||
return;
|
||||
}
|
||||
if (!code.value) {
|
||||
errorMsg.value = '请输入验证码';
|
||||
errorShow.value = true;
|
||||
return;
|
||||
}
|
||||
if (code.value.toLocaleLowerCase() !== verifyCode.value.toLocaleLowerCase()) {
|
||||
errorMsg.value = '请输入正确的验证码';
|
||||
errorShow.value = true;
|
||||
return;
|
||||
}
|
||||
// if (!code.value) {
|
||||
// errorMsg.value = '请输入验证码';
|
||||
// errorShow.value = true;
|
||||
// return;
|
||||
// }
|
||||
// if (code.value.toLocaleLowerCase() !== verifyCode.value.toLocaleLowerCase()) {
|
||||
// errorMsg.value = '请输入正确的验证码';
|
||||
// errorShow.value = true;
|
||||
// return;
|
||||
// }
|
||||
if (userName.value !== '' && password.value !== '') {
|
||||
errorShow.value = false;
|
||||
let data = JSON.stringify({ accountNo: userName.value, password: password.value });
|
||||
@@ -129,6 +129,10 @@
|
||||
loading.value = false;
|
||||
if (configStore.enablePermissions) {
|
||||
const res = await configStore.userResource(info);
|
||||
res?.data.sort((a, b) => {
|
||||
return a.sort - b.sort;
|
||||
});
|
||||
console.log(res.data);
|
||||
|
||||
if (configStore.customApplication) {
|
||||
await useAuthorization.initMenuResource();
|
||||
@@ -139,11 +143,11 @@
|
||||
if (item.type === 'menus' && item.menus && item.menus?.length !== 0) {
|
||||
dealInitUrl(item.menus[0]);
|
||||
} else {
|
||||
// if (item.type === 'noChildrenMenu') {
|
||||
initUrl.value = configStore.resourceName
|
||||
? item.code.replace(configStore.resourceName, '')
|
||||
: item.code;
|
||||
// }
|
||||
if (item.type === 'noChildrenMenu') {
|
||||
initUrl.value = configStore.resourceName
|
||||
? item.code.replace(configStore.resourceName, '')
|
||||
: item.code;
|
||||
}
|
||||
}
|
||||
};
|
||||
if (configStore.resourceName) {
|
||||
@@ -162,13 +166,15 @@
|
||||
const initRouterList = useAuthorization.getInitRouterList;
|
||||
|
||||
router.push({
|
||||
name: initRouterList.length === 0 ? 'error403' : initUrl.value,
|
||||
name: initRouterList.length === 0 ? 'error403' : res.data[0]['code'],
|
||||
});
|
||||
} else {
|
||||
router.replace({ name: 'root' });
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user