diff --git a/frontend/src/api/helper/check-status.ts b/frontend/src/api/helper/check-status.ts index 213a7002e..d05950b3c 100644 --- a/frontend/src/api/helper/check-status.ts +++ b/frontend/src/api/helper/check-status.ts @@ -13,7 +13,7 @@ export const checkStatus = (status: number, msg: string): void => { MsgError(msg ? msg : i18n.global.t('commons.res.notFound')); break; case 403: - router.replace({ path: '/login', params: { code: globalStore.entrance } }); + router.replace({ name: 'entrance', params: { code: globalStore.entrance } }); MsgError(msg ? msg : i18n.global.t('commons.res.forbidden')); break; case 500: diff --git a/frontend/src/api/index.ts b/frontend/src/api/index.ts index a6a96a64c..fd58611ee 100644 --- a/frontend/src/api/index.ts +++ b/frontend/src/api/index.ts @@ -43,7 +43,7 @@ class RequestHttp { } if (data.code == ResultEnum.OVERDUE || data.code == ResultEnum.FORBIDDEN) { router.push({ - name: 'login', + name: 'entrance', params: { code: globalStore.entrance }, }); return Promise.reject(data); diff --git a/frontend/src/components/app-layout/menu/index.vue b/frontend/src/components/app-layout/menu/index.vue index cf5533813..3c5d6c498 100644 --- a/frontend/src/components/app-layout/menu/index.vue +++ b/frontend/src/components/app-layout/menu/index.vue @@ -80,7 +80,7 @@ const logout = () => { }) .then(() => { systemLogOut(); - router.push({ name: 'login', params: { code: globalStore.entrance } }); + router.push({ name: 'entrance', params: { code: globalStore.entrance } }); globalStore.setLogStatus(false); MsgSuccess(i18n.global.t('commons.msg.operationSuccess')); }) diff --git a/frontend/src/routers/index.ts b/frontend/src/routers/index.ts index 4b15fa54c..762200c2b 100644 --- a/frontend/src/routers/index.ts +++ b/frontend/src/routers/index.ts @@ -17,7 +17,7 @@ router.beforeEach((to, from, next) => { const globalStore = GlobalStore(); if (!globalStore.isLogin) { next({ - name: 'login', + name: 'entrance', params: { code: globalStore.entrance }, }); NProgress.done(); diff --git a/frontend/src/routers/router.ts b/frontend/src/routers/router.ts index d245b6a65..b6ab56b93 100644 --- a/frontend/src/routers/router.ts +++ b/frontend/src/routers/router.ts @@ -58,7 +58,7 @@ menuList.unshift(homeRouter); export const routes: RouteRecordRaw[] = [ homeRouter, { - path: '/login/:code?', + path: '/login', name: 'login', props: true, component: () => import('@/views/login/index.vue'), @@ -67,6 +67,12 @@ export const routes: RouteRecordRaw[] = [ key: 'login', }, }, + { + path: '/:code?', + name: 'entrance', + component: () => import('@/views/login/entrance/index.vue'), + props: true, + }, ...routerArray, { path: '/:pathMatch(.*)', diff --git a/frontend/src/views/login/entrance/index.vue b/frontend/src/views/login/entrance/index.vue new file mode 100644 index 000000000..a096cdd44 --- /dev/null +++ b/frontend/src/views/login/entrance/index.vue @@ -0,0 +1,142 @@ + + + + + + + {{ $t('commons.login.title') }} + + + + + + + + + + + + + + + + + + + diff --git a/frontend/src/views/login/index.vue b/frontend/src/views/login/index.vue index f6dc183d0..18a6f29b1 100644 --- a/frontend/src/views/login/index.vue +++ b/frontend/src/views/login/index.vue @@ -1,6 +1,6 @@ - + @@ -15,34 +15,25 @@ - - -