liuxinyun 3 лет назад
Родитель
Сommit
9645db515c

+ 5 - 5
ele-admin-template/src/api/layout/index.js

@@ -11,12 +11,12 @@ export async function getUserInfo() {
   // if (res1111.code === 0 && res1111.data) {
   //   return res1111.data;
   // }
-  if (res222.code == 0 && res222.data) {
-    return res222.data;
-  }
-  // if (res.data.code == 0 && res.data.data) { 
-  //   return res.data.data;
+  // if (res222.code == 0 && res222.data) {
+  //   return res222.data;
   // }
+  if (res.data.code == 0 && res.data.data) { 
+    return res.data.data;
+  }
   return Promise.reject(new Error(res.data.message));
 }
 

+ 56 - 0
ele-admin-template/src/config/setting.js

@@ -25,6 +25,62 @@ export const KEEP_ALIVE_EXCLUDES = [];
 
 // 直接指定菜单数据
 export const USER_MENUS = undefined;
+// [
+//   {
+//     path: '/dashboard',
+//     redirect: '/dashboard/user',
+//     meta: { title: '流程管理', icon: 'el-icon-setting' }
+//   },
+//   {
+//     path: '/system',
+//     redirect: '/system/user',
+//     meta: { title: '流程管理', icon: 'el-icon-setting' },
+//     children: [
+//       {
+//         path: '/system/user',
+//         component: '/system/user',
+//         meta: { title: '流程定义', icon: 'el-icon-user', hide: false }
+//       },
+//       {
+//         path: '/system/user',
+//         component: '/system/user',
+//         meta: { title: '流程审批', icon: 'el-icon-user', hide: false }
+//       },
+//       {
+//         path: '/system/user',
+//         component: '/system/user',
+//         meta: { title: '流程实列', icon: 'el-icon-user', hide: false }
+//       }
+//     ]
+//   },
+//   {
+//     path: '/system',
+//     redirect: '/system/user',
+//     meta: { title: '授权管理', icon: 'el-icon-setting' },
+//     children: [
+//       {
+//         path: '/system/user',
+//         component: '/system/user',
+//         meta: { title: '用户管理', icon: 'el-icon-user', hide: false }
+//       },
+//       {
+//         path: '/system/user',
+//         component: '/system/user',
+//         meta: { title: '角色管理', icon: 'el-icon-user', hide: false }
+//       },
+//       {
+//         path: '/system/user',
+//         component: '/system/user',
+//         meta: { title: '租户管理', icon: 'el-icon-user', hide: false }
+//       },
+//       {
+//         path: '/system/user',
+//         component: '/system/user',
+//         meta: { title: '菜单管理', icon: 'el-icon-user', hide: false }
+//       }
+//     ]
+//   }
+// ];
 
 // 首页名称, 为空则取第一个菜单的名称
 export const HOME_TITLE = undefined;

+ 46 - 10
ele-admin-template/src/store/modules/user.js

@@ -39,34 +39,70 @@ export default {
     /**
      * 请求用户信息、权限、角色、菜单
      */
+    // async fetchUserInfo({ commit }) {
+    //   const result = await getUserInfo().catch(() => {});
+    //   if (!result) {
+    //     return {};
+    //   }
+    //   // 用户信息
+    //   commit('setUserInfo', result);
+    //   // 用户权限
+    //   const authorities =
+    //     result.authorities
+    //       ?.filter((d) => !!d.authority)
+    //       ?.map((d) => d.authority) ?? [];
+    //   commit('setAuthorities', authorities);
+    //   // 用户角色
+    //   const roles = result.roles?.map((d) => d.roleCode) ?? [];
+    //   commit('setRoles', roles);
+    //   // 用户菜单, 过滤掉按钮类型并转为 children 形式
+    //   const { menus, homePath } = formatMenus(
+    //     USER_MENUS ??
+    //       toTreeData({
+    //         data: result.authorities?.filter((d) => d.menuType !== 1),
+    //         idField: 'menuId',
+    //         parentIdField: 'parentId'
+    //       })
+    //   );
+    //   commit('setMenus', menus); 
+    //   console.log('menus',menus, 'homePath',homePath)
+    //   return { menus, homePath };
+    // },
+    //动态路由
     async fetchUserInfo({ commit }) {
       const result = await getUserInfo().catch(() => {});
+      console.log('result--',result)
       if (!result) {
         return {};
       }
       // 用户信息
-      commit('setUserInfo', result);
+      // commit('setUserInfo', result);
       // 用户权限
-      const authorities =
-        result.authorities
-          ?.filter((d) => !!d.authority)
-          ?.map((d) => d.authority) ?? [];
-      commit('setAuthorities', authorities);
+      // const authorities =
+      //   result.authorities
+      //     ?.filter((d) => !!d.authority)
+      //     ?.map((d) => d.authority) ?? [];
+      // commit('setAuthorities', authorities);
       // 用户角色
-      const roles = result.roles?.map((d) => d.roleCode) ?? [];
-      commit('setRoles', roles);
+      // const roles = result.roles?.map((d) => d.roleCode) ?? [];
+      // commit('setRoles', roles);
       // 用户菜单, 过滤掉按钮类型并转为 children 形式
       const { menus, homePath } = formatMenus(
         USER_MENUS ??
           toTreeData({
-            data: result.authorities?.filter((d) => d.menuType !== 1),
-            idField: 'menuId',
+            data: result?.filter((d) => d.menuType !== 1),
+            idField: 'id',
             parentIdField: 'parentId'
           })
       );
+      
+      // console.log('menus--',menus)
       commit('setMenus', menus);
+      // const menus = result;
+      // const homePath = '/dashboard/workplace';
       return { menus, homePath };
     },
+
     /**
      * 更新用户信息
      */

+ 0 - 0
ele-admin-template/src/views/dashboard.vue


+ 11 - 0
ele-admin-template/src/views/flowable/flowableDefine.vue

@@ -0,0 +1,11 @@
+<template>
+    <div>流程定义</div>
+</template>
+<script>
+export default {
+    
+}
+</script>
+<style scoped>
+
+</style>

+ 1 - 1
ele-admin-template/vue.config.js

@@ -17,7 +17,7 @@ module.exports = {
       '/api': {
         // target: 'http://192.168.3.51:18086', // 跨域请求的地址
         // target: 'http://192.168.3.35:8080', // kang杨威
-        target: 'http://192.168.3.31:8080', // 黄峥嵘
+        target: 'http://192.168.3.25:8080', // 黄峥嵘
         changeOrigin: true, // 只有这个值为true的情况下 才表示开启跨域
         pathRewrite: {
           '^/api': ''