a6fe3478 by lihua

登录页面改成主页

1 parent 6aabcc7e
...@@ -38,10 +38,11 @@ router.beforeEach(async (to, from, next) => { ...@@ -38,10 +38,11 @@ router.beforeEach(async (to, from, next) => {
38 settingsStore.settings.menu.menuMode !== 'single' && menuStore.setActived(to.path) 38 settingsStore.settings.menu.menuMode !== 'single' && menuStore.setActived(to.path)
39 // 如果已登录状态下,进入登录页会强制跳转到主页 39 // 如果已登录状态下,进入登录页会强制跳转到主页
40 if (to.name === 'login') { 40 if (to.name === 'login') {
41 next({ 41 // next({
42 name: 'login', 42 // name: 'login',
43 replace: true, 43 // replace: true,
44 }) 44 // })
45 window.location.href = userStore.idassLoginUrl;
45 } 46 }
46 else if (to.name == 'scenes') { 47 else if (to.name == 'scenes') {
47 next({ 48 next({
...@@ -130,12 +131,13 @@ router.beforeEach(async (to, from, next) => { ...@@ -130,12 +131,13 @@ router.beforeEach(async (to, from, next) => {
130 next() 131 next()
131 } 132 }
132 else if (!to.query.code && to.name !== 'login') { 133 else if (!to.query.code && to.name !== 'login') {
133 next({ 134 window.location.href = userStore.idassLoginUrl;
134 name: 'login', 135 // next({
135 query: { 136 // name: 'login',
136 redirect: to.fullPath !== '/' ? to.fullPath : undefined, 137 // query: {
137 }, 138 // redirect: to.fullPath !== '/' ? to.fullPath : undefined,
138 }) 139 // },
140 // })
139 } 141 }
140 else { 142 else {
141 next() 143 next()
......
...@@ -27,14 +27,14 @@ interface metaInfoRaw { ...@@ -27,14 +27,14 @@ interface metaInfoRaw {
27 27
28 // 固定路由(默认路由) 28 // 固定路由(默认路由)
29 const constantRoutes: RouteRecordRaw[] = [ 29 const constantRoutes: RouteRecordRaw[] = [
30 { 30 // {
31 path: '/login', 31 // path: '/login',
32 name: 'login', 32 // name: 'login',
33 component: () => import('@/views/login.vue'), 33 // component: () => import('@/views/login.vue'),
34 meta: { 34 // meta: {
35 title: '登录', 35 // title: '登录',
36 }, 36 // },
37 }, 37 // },
38 { 38 {
39 path: '/register', 39 path: '/register',
40 name: 'register', 40 name: 'register',
......
...@@ -176,7 +176,7 @@ const useUserStore = defineStore( ...@@ -176,7 +176,7 @@ const useUserStore = defineStore(
176 menuStore.setActived(0) 176 menuStore.setActived(0)
177 tabbar.value = [] 177 tabbar.value = []
178 tabbarMap.value = {} 178 tabbarMap.value = {}
179 window.location.href = idassLoginUrl + '?logout=1'; 179 window.location.href = idassLoginUrl.value + '?logout=1';
180 }); 180 });
181 } else { 181 } else {
182 let hasCode = localStorage.getItem('code'); 182 let hasCode = localStorage.getItem('code');
...@@ -195,7 +195,7 @@ const useUserStore = defineStore( ...@@ -195,7 +195,7 @@ const useUserStore = defineStore(
195 tabbar.value = [] 195 tabbar.value = []
196 tabbarMap.value = {} 196 tabbarMap.value = {}
197 if (hasCode) { 197 if (hasCode) {
198 window.location.href = idassLoginUrl + '?logout=1'; 198 window.location.href = idassLoginUrl.value + '?logout=1';
199 } else { 199 } else {
200 router.push({ 200 router.push({
201 name: 'login', 201 name: 'login',
...@@ -313,6 +313,7 @@ const useUserStore = defineStore( ...@@ -313,6 +313,7 @@ const useUserStore = defineStore(
313 permissions, 313 permissions,
314 isLogin, 314 isLogin,
315 isLoginOut, 315 isLoginOut,
316 idassLoginUrl,
316 getTokenPromise, 317 getTokenPromise,
317 getToken, 318 getToken,
318 login, 319 login,
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!