| | |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.$store.dispatch('LogOut').then(() => { |
| | | this.$router.push({ path: "/login" }) |
| | | location.href = this.$router.options.base + '/index'; |
| | | }) |
| | | }).catch(() => {}); |
| | | } |
| | |
| | | ] |
| | | |
| | | export default new Router({ |
| | | base: "", // 项目前缀 与 publicPath 同步 例如 /api |
| | | mode: 'history', // 去掉url中的# |
| | | scrollBehavior: () => ({ y: 0 }), |
| | | routes: constantRoutes |
| | |
| | | } |
| | | ).then(() => { |
| | | store.dispatch('LogOut').then(() => { |
| | | location.href = '/index'; |
| | | location.href = this.$router.options.base + '/index'; |
| | | }) |
| | | }).catch(() => {}); |
| | | return Promise.reject('无效的会话,或者会话已过期,请重新登录。') |
| | |
| | | // 部署生产环境和开发环境下的URL。 |
| | | // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 |
| | | // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 |
| | | // 设置基路径参考文档: http://doc.ruoyi.vip/ruoyi-vue/document/qdsc.html#应用路径 |
| | | publicPath: process.env.NODE_ENV === "production" ? "/" : "/", |
| | | // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist) |
| | | outputDir: 'dist', |