|
@@ -10,8 +10,8 @@ import { i18nRender } from '@/locales'
|
|
|
NProgress.configure({ showSpinner: false }) // NProgress Configuration
|
|
|
|
|
|
const allowList = ['login', 'register', 'registerResult'] // no redirect allowList
|
|
|
-const loginRoutePath = '/user/login'
|
|
|
-const defaultRoutePath = '/list/table-list'
|
|
|
+const loginRoutePath = '/manager/user/login'
|
|
|
+const defaultRoutePath = '/manager/list/table-list'
|
|
|
|
|
|
router.beforeEach((to, from, next) => {
|
|
|
to.meta && typeof to.meta.title !== 'undefined' && setDocumentTitle(`${i18nRender(to.meta.title)} - ${domTitle}`)
|
|
@@ -86,8 +86,12 @@ router.beforeEach((to, from, next) => {
|
|
|
console.log('Router guard - white list path, proceeding')
|
|
|
next()
|
|
|
} else {
|
|
|
- console.log('Router guard - redirecting to login')
|
|
|
- next({ path: loginRoutePath, query: { redirect: to.fullPath } })
|
|
|
+ console.log('Router guard - redirecting to login' + to.fullPath)
|
|
|
+ if (to.fullPath === '/404') {
|
|
|
+ next({ path: loginRoutePath })
|
|
|
+ } else {
|
|
|
+ next({ path: loginRoutePath, query: { redirect: to.fullPath } })
|
|
|
+ }
|
|
|
NProgress.done() // if current page is login will not trigger afterEach hook, so manually handle it
|
|
|
}
|
|
|
}
|