菜单布局等初步完成
This commit is contained in:
@@ -141,12 +141,12 @@ const handleLogin = async () => {
|
||||
loginLoading.value = true;
|
||||
|
||||
// 调用store中的登录action
|
||||
await store.dispatch('auth/login', loginForm);
|
||||
const result = await store.dispatch('auth/login', loginForm);
|
||||
|
||||
ElMessage.success('登录成功!');
|
||||
|
||||
// 获取重定向路径
|
||||
const redirectPath = (route.query.redirect as string) || '/dashboard';
|
||||
// 优先使用 query 中的 redirect,其次使用返回的 redirectUrl,最后使用默认首页
|
||||
const redirectPath = (route.query.redirect as string) || result.redirectUrl || '/home';
|
||||
router.push(redirectPath);
|
||||
|
||||
} catch (error: any) {
|
||||
|
||||
Reference in New Issue
Block a user