From 2173ed504d2f3dc0f727c2b10230ee14ed0c9436 Mon Sep 17 00:00:00 2001
From: 疯狂的狮子Li <15040126243@163.com>
Date: 星期日, 24 十月 2021 17:23:15 +0800
Subject: [PATCH] update 更新关于全局路径设置与文档链接

---
 ruoyi-ui/src/utils/request.js             |    2 +-
 ruoyi-ui/vue.config.js                    |    1 +
 ruoyi-ui/src/router/index.js              |    1 +
 ruoyi-ui/src/layout/components/Navbar.vue |    2 +-
 4 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/ruoyi-ui/src/layout/components/Navbar.vue b/ruoyi-ui/src/layout/components/Navbar.vue
index 075bf74..e6721b7 100644
--- a/ruoyi-ui/src/layout/components/Navbar.vue
+++ b/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(() => {});
     }
diff --git a/ruoyi-ui/src/router/index.js b/ruoyi-ui/src/router/index.js
index 96f557b..cedf0b3 100644
--- a/ruoyi-ui/src/router/index.js
+++ b/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
diff --git a/ruoyi-ui/src/utils/request.js b/ruoyi-ui/src/utils/request.js
index 4acc3b4..e8b3b5f 100644
--- a/ruoyi-ui/src/utils/request.js
+++ b/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('鏃犳晥鐨勪細璇濓紝鎴栬�呬細璇濆凡杩囨湡锛岃閲嶆柊鐧诲綍銆�')
diff --git a/ruoyi-ui/vue.config.js b/ruoyi-ui/vue.config.js
index ee6353c..4d6967b 100644
--- a/ruoyi-ui/vue.config.js
+++ b/ruoyi-ui/vue.config.js
@@ -16,6 +16,7 @@
   // 閮ㄧ讲鐢熶骇鐜鍜屽紑鍙戠幆澧冧笅鐨刄RL銆�
   // 榛樿鎯呭喌涓嬶紝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" ? "/" : "/",
   // 鍦╪pm run build 鎴� yarn build 鏃� 锛岀敓鎴愭枃浠剁殑鐩綍鍚嶇О锛堣鍜宐aseUrl鐨勭敓浜х幆澧冭矾寰勪竴鑷达級锛堥粯璁ist锛�
   outputDir: 'dist',

--
Gitblit v1.9.3