ソースを参照

fix: 未配置 首页默认 进入 /home 页面

yanglzh 2 年 前
コミット
e063b284df
2 ファイル変更2 行追加2 行削除
  1. 1 1
      src/router/index.ts
  2. 1 1
      src/views/login/component/account.vue

+ 1 - 1
src/router/index.ts

@@ -171,7 +171,7 @@ export async function setAddRoute() {
 	// 修改首页重定向的地址,从后台配置中获取首页的地址并在登录之后和刷新页面时进行修改
 	const sysinfo = JSON.parse(localStorage.sysinfo || '{}');
 	const homePage = router.getRoutes().find((item) => item.path === '/');
-	homePage && sysinfo.systemHomePageRoute && (homePage.redirect = sysinfo.systemHomePageRoute);
+	homePage && sysinfo.systemHomePageRoute && (homePage.redirect = sysinfo.systemHomePageRoute) || '/home';
 }
 
 /**

+ 1 - 1
src/views/login/component/account.vue

@@ -174,7 +174,7 @@ export default defineComponent({
 			// 修改首页重定向的地址,从后台配置中获取首页的地址并在登录之后和刷新页面时进行修改
 			const sysinfo = JSON.parse(localStorage.sysinfo || '{}');
 			const homePage = router.getRoutes().find((item) => item.path === '/');
-			homePage && (homePage.redirect = sysinfo.systemHomePageRoute);
+			homePage && (homePage.redirect = sysinfo.systemHomePageRoute || '/home');
 			// 初始化登录成功时间问候语
 			let currentTimeInfo = currentTime.value;
 			// 登录成功,跳到转首页