From ffe3cbe4e5e932e650773fe7e71fb609b2d9cecd Mon Sep 17 00:00:00 2001 From: ZhengJie <201507802@qq.com> Date: Thu, 17 Sep 2020 20:08:26 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BB=A3=E7=A0=81=E5=AE=8C=E5=96=84](v2.6):?= =?UTF-8?q?=20=E9=80=82=E9=85=8DNginx=E5=8F=8D=E5=90=91=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E9=83=A8=E7=BD=B2/=E5=B7=A5=E4=BF=A1=E9=83=A8=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.production | 2 +- src/layout/components/AppMain.vue | 2 +- src/router/index.js | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.env.production b/.env.production index 34735fe..17aa07e 100644 --- a/.env.production +++ b/.env.production @@ -1,6 +1,6 @@ ENV = 'production' -# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',后续文档更新 Nginx 反向部署教程 +# 如果使用 Nginx 代理后端接口,那么此处需要改为 '/',文件查看 Docker 部署篇,Nginx 配置 # 接口地址,注意协议,如果你没有配置 ssl,需要将 https 改为 http VUE_APP_BASE_API = 'https://api.auauz.net' # 如果接口是 http 形式, wss 需要改为 ws diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index c235dc9..92229f1 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -8,7 +8,7 @@
diff --git a/src/router/index.js b/src/router/index.js index ba03435..7904706 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -23,11 +23,10 @@ router.beforeEach((to, from, next) => { NProgress.done() } else { if (store.getters.roles.length === 0) { // 判断当前用户是否已拉取完user_info信息 - store.dispatch('GetInfo').then(res => { // 拉取user_info + store.dispatch('GetInfo').then(() => { // 拉取user_info // 动态路由,拉取菜单 loadMenus(next, to) - }).catch((err) => { - console.log(err) + }).catch(() => { store.dispatch('LogOut').then(() => { location.reload() // 为了重新实例化vue-router对象 避免bug }) @@ -35,7 +34,7 @@ router.beforeEach((to, from, next) => { // 登录时未拉取 菜单,在此处拉取 } else if (store.getters.loadMenus) { // 修改成false,防止死循环 - store.dispatch('updateLoadMenus').then(res => {}) + store.dispatch('updateLoadMenus') loadMenus(next, to) } else { next()