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