hookehuyr

暂时屏蔽登录重定向的功能

......@@ -67,7 +67,8 @@ export const checkAuth = (to) => {
if (needAuth && !currentUser) {
// 未登录时重定向到登录页面
return { path: '/login', query: { redirect: to.fullPath } }
// return { path: '/login', query: { redirect: to.fullPath } }
return { path: '/login' }
}
return true
......
......@@ -2,7 +2,7 @@
* @Author: hookehuyr hookehuyr@gmail.com
* @Date: 2022-05-28 10:17:40
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2025-05-08 17:45:44
* @LastEditTime: 2025-06-13 09:56:29
* @FilePath: /mlaj/src/utils/axios.js
* @Description:
*/
......@@ -48,7 +48,8 @@ axios.interceptors.response.use(
localStorage.removeItem('currentUser');
// 跳转到登录页面,并携带当前路由信息
const currentPath = router.currentRoute.value.fullPath;
router.push(`/login?redirect=${encodeURIComponent(currentPath)}`);
// router.push(`/login?redirect=${encodeURIComponent(currentPath)}`);
router.push(`/login`);
}
return response;
},
......
......@@ -287,8 +287,9 @@ const handleSubmit = async () => {
if (success) {
// 如果有重定向参数,登录成功后跳转到对应页面
const redirect = $route.query.redirect;
router.push(redirect || "/");
// const redirect = $route.query.redirect;
// router.push(redirect || "/");
router.push("/");
} else {
error.value = "登录失败,请检查您的输入项";
}
......