diff --git a/ruoyi-ui/.env.development b/ruoyi-ui/.env.development index 9da3bd2..4fae17c 100644 --- a/ruoyi-ui/.env.development +++ b/ruoyi-ui/.env.development @@ -5,7 +5,7 @@ VUE_APP_TITLE = 广州市城市建设职业学校 ENV = 'development' # 若依管理系统/开发环境 -# VUE_APP_BASE_API = '/dev-api' +VUE_APP_BASE_API = '/dev-api' # 应用访问路径 例如使用前缀 /admin/ VUE_APP_CONTEXT_PATH = '/' @@ -17,7 +17,7 @@ VUE_APP_MONITRO_ADMIN = 'http://localhost:9090/admin/login' VUE_APP_XXL_JOB_ADMIN = 'http://localhost:9100/xxl-job-admin' # VUE_APP_BASE_API = 'https://bxserver.mhito.net:8090' -VUE_APP_BASE_API = 'http://192.168.1.55:8080' +# VUE_APP_BASE_API = 'http://192.168.1.55:8080' # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/ruoyi-ui/dist.rar b/ruoyi-ui/dist.rar deleted file mode 100644 index acf26a5..0000000 Binary files a/ruoyi-ui/dist.rar and /dev/null differ diff --git a/ruoyi-ui/src/permission.js b/ruoyi-ui/src/permission.js index 609d215..beae172 100644 --- a/ruoyi-ui/src/permission.js +++ b/ruoyi-ui/src/permission.js @@ -30,11 +30,11 @@ router.beforeEach((to, from, next) => { next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 }) }).catch(err => { - store.dispatch('LogOut').then(() => { - Message.error(err) - next({ path: '/' }) - }) + store.dispatch('LogOut').then(() => { + Message.error(err) + next({ path: '/' }) }) + }) } else { next() } @@ -45,7 +45,11 @@ router.beforeEach((to, from, next) => { // 在免登录白名单,直接进入 next() } else { - next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页 + localStorage.setItem("intendedRoute", to.fullPath); + next({ + path: '/login', + query: { redirect: to.fullPath } + }) // 否则全部重定向到登录页 NProgress.done() } } diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js index 0f6d60a..dd62e21 100644 --- a/ruoyi-ui/src/router/index.js +++ b/ruoyi-ui/src/router/index.js @@ -262,23 +262,23 @@ const router = new Router({ routes: constantRoutes, }); -router.beforeEach((to, from, next) => { - let token = getToken(); - debugger; - if (token) { - // 如果有token - next(); - } else { - if (to.path == "/login") { - next(); - } else { - if (to.path.includes("bx/start")) { - next(); - } else { - next("/login"); - } - } - } -}); +// router.beforeEach((to, from, next) => { +// let token = getToken(); +// debugger; +// if (token) { +// // 如果有token +// next(); +// } else { +// if (to.path == "/login") { +// next(); +// } else { +// if (to.path.includes("bx/start")) { +// next(); +// } else { +// next("/login"); +// } +// } +// } +// }); export default router; diff --git a/ruoyi-ui/src/views/login.vue b/ruoyi-ui/src/views/login.vue index 34c551d..fde94fd 100644 --- a/ruoyi-ui/src/views/login.vue +++ b/ruoyi-ui/src/views/login.vue @@ -1,5 +1,5 @@