feat: 登录与菜单权限联调问题修复

pull/2/head
刘释隆 1 year ago
parent 8b175cadf3
commit 6b61f93599

@ -175,11 +175,14 @@ function handleSubmit(e) {
localStorage.removeItem("LOGIN_FORM_PASS");
}
loginSuccess.value = true;
const userInfo = await userStore.getInformation();
const { data: userInfo } = await userStore.getInformation();
message.destroyAll();
const toPath = decodeURIComponent((route.query?.redirect || "/") as string);
message.success("登录成功,即将进入系统");
if (route.name === LOGIN_NAME) router.replace(userInfo.frontmenuTList[0]['resUrl']);
if (route.name === LOGIN_NAME)
router.replace(
userInfo.frontmenuTList ? userInfo.frontmenuTList[0]["resUrl"] : "/"
);
else router.replace(toPath);
} else {
loginSuccess.value = false;
@ -243,11 +246,14 @@ function handleSmsSubmit(e) {
loginSuccess.value = true;
// const { code, message: msg } = await userStore.login(params)
await userStore.setStorageToken(res.data);
const userInfo = await userStore.getInformation();
const { data: userInfo } = await userStore.getInformation();
message.destroyAll();
const toPath = decodeURIComponent((route.query?.redirect || "/") as string);
message.success("登录成功,即将进入系统");
if (route.name === LOGIN_NAME) router.replace(userInfo.frontmenuTList[0]['resUrl']);
if (route.name === LOGIN_NAME)
router.replace(
userInfo.frontmenuTList ? userInfo.frontmenuTList[0]["resUrl"] : "/"
);
else router.replace(toPath);
} else {
message.destroyAll();

Loading…
Cancel
Save