sunlupeng 3 months ago
parent
commit
3c207b306d
2 changed files with 6 additions and 6 deletions
  1. 4 4
      config/dev.env.js
  2. 2 2
      src/permission.js

+ 4 - 4
config/dev.env.js

@@ -4,10 +4,10 @@ module.exports = {
   // 本地数据库:登录用户名 admin123,密码 admin123
   // BASE_API: '"http://192.168.100.87:9083/admin"',
   // OS_API: '"http://192.168.100.87:9083/admin"',
-  BASE_API: '"http://47.103.79.143:9085/admin"',
-  OS_API: '"http://47.103.79.143:9085/admin"',
-  // OS_API: '"https://xiaoyou.dgtis.com/admin"',
-  // BASE_API: '"https://xiaoyou.dgtis.com/admin"',
+  // BASE_API: '"http://47.103.79.143:9085/admin"',
+  // OS_API: '"http://47.103.79.143:9085/admin"',
+  OS_API: '"https://xiaoyou.dgtis.com/admin"',
+  BASE_API: '"https://xiaoyou.dgtis.com/admin"',
   
   
   

+ 2 - 2
src/permission.js

@@ -132,8 +132,8 @@ router.beforeEach((to, from, next) => {
       if (store.getters.roles.length === 0) { // 判断当前用户是否已拉取完user_info信息
         store.dispatch('GetUserInfo').then(res => {
           store.dispatch('GetUserMenus').then(res => { // 拉取user_info
-            // const roles = res.data.data // note: roles must be a array! such as: ['editor','develop']
-            const roles = myRoles;
+            const roles = res.data.data // note: roles must be a array! such as: ['editor','develop']
+            // const roles = myRoles;
             store.dispatch('GenerateRoutes', { roles }).then(() => { // 根据roles权限生成可访问的路由表
               router.addRoutes(store.getters.addRouters) // 动态添加可访问路由表
               next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record