疯狂的狮子Li
2021-10-24 2173ed504d2f3dc0f727c2b10230ee14ed0c9436
update 更新关于全局路径设置与文档链接
已修改4个文件
6 ■■■■■ 文件已修改
ruoyi-ui/src/layout/components/Navbar.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/router/index.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/utils/request.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/vue.config.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-ui/src/layout/components/Navbar.vue
@@ -102,7 +102,7 @@
        type: 'warning'
      }).then(() => {
        this.$store.dispatch('LogOut').then(() => {
          this.$router.push({ path: "/login" })
          location.href = this.$router.options.base + '/index';
        })
      }).catch(() => {});
    }
ruoyi-ui/src/router/index.js
@@ -167,6 +167,7 @@
]
export default new Router({
  base: "", // 项目前缀 与 publicPath 同步 例如 /api
  mode: 'history', // 去掉url中的#
  scrollBehavior: () => ({ y: 0 }),
  routes: constantRoutes
ruoyi-ui/src/utils/request.js
@@ -65,7 +65,7 @@
        }
      ).then(() => {
        store.dispatch('LogOut').then(() => {
          location.href = '/index';
          location.href = this.$router.options.base + '/index';
        })
      }).catch(() => {});
      return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
ruoyi-ui/vue.config.js
@@ -16,6 +16,7 @@
  // 部署生产环境和开发环境下的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',