wangfei пре 6 година
родитељ
комит
427331913b

+ 29
- 62
src/pages/system/systemSet/roleManager/add.vue Прегледај датотеку

@@ -2,57 +2,18 @@
2 2
   <div class="subPage">
3 3
     <form class="mainForm">
4 4
       <ul>
5
-        <li class="flex-h">
6
-          <span>角色名:</span>
7
-          <div class="flex-item">
8
-            <div style="width:50%">
9
-              <el-input
10
-                placeholder="只能输入英文"
11
-                v-model="postData.roleId"
12
-                clearable>
13
-              </el-input>
14
-            </div>
15
-          </div>
16
-        </li>
17 5
         <li class="flex-h">
18 6
           <span>角色名称:</span>
19 7
           <div class="flex-item">
20 8
             <div style="width:50%">
21 9
               <el-input
22 10
                 placeholder="请输入角色名称"
23
-                v-model="postData.roleName"
11
+                v-model="detail.RoleName"
24 12
                 clearable>
25 13
               </el-input>
26 14
             </div>
27 15
           </div>
28 16
         </li>
29
-        <li class="flex-h">
30
-          <span>禁用角色:</span>
31
-          <div class="flex-item">
32
-            <div style="width:50%" class="switch">
33
-              <el-switch
34
-                v-model="postData.disable"
35
-                active-color="#13ce66"
36
-                inactive-color="#ff4949">
37
-              </el-switch>
38
-            </div>
39
-          </div>
40
-        </li>
41
-        <li class="flex-h">
42
-          <span>数据权限:</span>
43
-          <div class="flex-item">
44
-            <div style="width:50%">
45
-              <el-select v-model="postData.permission" placeholder="请选择">
46
-                <el-option
47
-                  v-for="item in permissionList"
48
-                  :key="item.value"
49
-                  :label="item.name"
50
-                  :value="item.value">
51
-                </el-option>
52
-              </el-select>
53
-            </div>
54
-          </div>
55
-        </li>
56 17
         <li class="flex-h">
57 18
           <span>备注:</span>
58 19
           <div class="flex-item">
@@ -61,7 +22,7 @@
61 22
                 placeholder="请输入备注"
62 23
                 type="textarea"
63 24
                 :autosize="{ minRows: 3, maxRows: 5}"
64
-                v-model="postData.remark"
25
+                v-model="detail.Remark"
65 26
                 clearable>
66 27
               </el-input>
67 28
             </div>
@@ -77,39 +38,45 @@
77 38
 </template>
78 39
 
79 40
 <script>
41
+import { createNamespacedHelpers, mapState } from 'vuex'
42
+
43
+const { mapState: mapRoleState, mapActions: mapRoleActions } = createNamespacedHelpers('role')
80 44
 export default {
81 45
   name: '',
82 46
   data () {
83
-    return {
84
-      postData: {
85
-        roleId: '', // 角色名
86
-        roleName: '', // 角色姓名
87
-        disable: false, // 禁用角色
88
-        permission: '', // 数据权限
89
-        remark: '' // 备注
90
-      },
91
-      permissionList: [{
92
-        value: '0',
93
-        name: '个人数据'
94
-      }, {
95
-        value: '1',
96
-        name: '所属组织全部数据'
97
-      }, {
98
-        value: '2',
99
-        name: '所属组织及下层全部数据'
100
-      }]
101
-    }
47
+    return {}
102 48
   },
103 49
   components: {},
50
+  computed: {
51
+    ...mapRoleState({
52
+      detail: x => x.roleInfo,
53
+    }),
54
+    ...mapState({
55
+      caseid: x => x.app.cases.default,
56
+      orgid: x => x.app.user.OrgId,
57
+    })
58
+  },
104 59
   methods: {
60
+    ...mapRoleActions([
61
+      'GetRoleByID',
62
+      'AddRole',
63
+      'UpdateRole',
64
+    ]),
105 65
     submit () {
106
-      console.log(this.postData)
66
+      if ((this.detail.RoleId || '') === '') {
67
+        this.detail.CaseId = this.caseid
68
+        this.detail.OrgId = this.orgid
69
+        this.AddRole(this.detail)
70
+      } else {
71
+        this.UpdateRole(this.detail)
72
+      }
107 73
     },
108 74
     cancel () {
109 75
       this.$router.go(-1)
110 76
     }
111 77
   },
112
-  mounted () { }
78
+  beforeMount () {
79
+  }
113 80
 }
114 81
 </script>
115 82
 

+ 0
- 51
src/pages/system/systemSet/roleManager/edit.vue Прегледај датотеку

@@ -2,18 +2,6 @@
2 2
   <div class="subPage">
3 3
     <form class="mainForm">
4 4
       <ul>
5
-        <li class="flex-h">
6
-          <span>角色名:</span>
7
-          <div class="flex-item">
8
-            <div style="width:50%">
9
-              <el-input
10
-                placeholder="只能输入英文"
11
-                v-model="postData.roleId"
12
-                clearable>
13
-              </el-input>
14
-            </div>
15
-          </div>
16
-        </li>
17 5
         <li class="flex-h">
18 6
           <span>角色名称:</span>
19 7
           <div class="flex-item">
@@ -26,33 +14,6 @@
26 14
             </div>
27 15
           </div>
28 16
         </li>
29
-        <li class="flex-h">
30
-          <span>禁用角色:</span>
31
-          <div class="flex-item">
32
-            <div style="width:50%" class="switch">
33
-              <el-switch
34
-                v-model="postData.disable"
35
-                active-color="#13ce66"
36
-                inactive-color="#ff4949">
37
-              </el-switch>
38
-            </div>
39
-          </div>
40
-        </li>
41
-        <li class="flex-h">
42
-          <span>数据权限:</span>
43
-          <div class="flex-item">
44
-            <div style="width:50%">
45
-              <el-select v-model="postData.permission" placeholder="请选择">
46
-                <el-option
47
-                  v-for="item in permissionList"
48
-                  :key="item.value"
49
-                  :label="item.name"
50
-                  :value="item.value">
51
-                </el-option>
52
-              </el-select>
53
-            </div>
54
-          </div>
55
-        </li>
56 17
         <li class="flex-h">
57 18
           <span>备注:</span>
58 19
           <div class="flex-item">
@@ -84,20 +45,8 @@ export default {
84 45
       postData: {
85 46
         roleId: '', // 角色名
86 47
         roleName: '', // 角色姓名
87
-        disable: false, // 禁用角色
88
-        permission: '', // 数据权限
89 48
         remark: '' // 备注
90 49
       },
91
-      permissionList: [{
92
-        value: '0',
93
-        name: '个人数据'
94
-      }, {
95
-        value: '1',
96
-        name: '所属组织全部数据'
97
-      }, {
98
-        value: '2',
99
-        name: '所属组织及下层全部数据'
100
-      }]
101 50
     }
102 51
   },
103 52
   components: {},

+ 30
- 95
src/pages/system/systemSet/roleManager/index.vue Прегледај датотеку

@@ -10,16 +10,10 @@
10 10
       <div class="moreFilter"></div>
11 11
     </div>
12 12
     <div class="system-table-box">
13
-      <el-table :data="tableData" stripe style="width: 100%">
14
-        <el-table-column fixed='left' prop="role" label="角色标识" width="150">
13
+      <el-table :data="roles.list" stripe style="width: 100%">
14
+        <el-table-column prop="RoleName" label="角色名">
15 15
         </el-table-column>
16
-        <el-table-column prop="roleName" label="角色名" width="150">
17
-        </el-table-column>
18
-        <el-table-column prop="disable" label="是否禁用角色" width="150">
19
-        </el-table-column>
20
-        <el-table-column prop="permission" label="数据权限">
21
-        </el-table-column>
22
-        <el-table-column prop="createTime" label="创建时间" width="200">
16
+        <el-table-column prop="FormatDate(CreateDate)" label="创建时间" width="300">
23 17
         </el-table-column>
24 18
         <el-table-column fixed='right' label="操作" width="300">
25 19
           <template slot-scope="scope">
@@ -30,9 +24,15 @@
30 24
         </el-table-column>
31 25
       </el-table>
32 26
     </div>
33
-    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="currentPage" :page-size="10" layout="prev, pager, next, jumper" :total="100">
27
+    <el-pagination
28
+    @size-change="handleSizeChange"
29
+    @current-change="handleCurrentChange"
30
+    :current-page.sync="currentPage"
31
+    :page-size="10"
32
+    layout="prev, pager, next, jumper"
33
+    :total="roles.pagenum">
34 34
     </el-pagination>
35
-    <el-dialog title="请选择机构" :visible.sync="dialogTableVisible">
35
+    <!-- <el-dialog title="请选择机构" :visible.sync="dialogTableVisible">
36 36
       <el-tree
37 37
         class="flxe-h"
38 38
         :data="treeData"
@@ -44,13 +44,16 @@
44 44
         <div class="flex-h" style="justify-content: flex-end;margin-top: 1rem">
45 45
           <el-button type='success' @click="getCheckedNodes">确定</el-button>
46 46
         </div>
47
-    </el-dialog>
47
+    </el-dialog> -->
48 48
   </div>
49 49
 </template>
50 50
 
51 51
 <script>
52
+import { createNamespacedHelpers } from 'vuex'
52 53
 import tableSearch from '@/components/tableSearch/index'
53 54
 
55
+const { mapState: mapRoleState, mapActions: mapRoleActions } = createNamespacedHelpers('role')
56
+
54 57
 export default {
55 58
   name: '',
56 59
   data () {
@@ -61,94 +64,23 @@ export default {
61 64
         key: '111' // 搜索关键字
62 65
       },
63 66
       dialogTableVisible: false,
64
-      tableData: [
65
-        {
66
-          role: '赵日天',
67
-          roleName: '赵日天',
68
-          disable: '赵日地',
69
-          permission: '赵日天',
70
-          createTime: '赵爸爸'
71
-        }, {
72
-          role: '赵日天',
73
-          roleName: '赵日天',
74
-          disable: '赵日地',
75
-          permission: '赵日天',
76
-          createTime: '赵爸爸'
77
-        }, {
78
-          role: '赵日天',
79
-          roleName: '赵日天',
80
-          disable: '赵日地',
81
-          permission: '赵日天',
82
-          createTime: '赵爸爸'
83
-        }, {
84
-          role: '赵日天',
85
-          roleName: '赵日天',
86
-          disable: '赵日地',
87
-          permission: '赵日天',
88
-          createTime: '赵爸爸'
89
-        }, {
90
-          role: '赵日天',
91
-          roleName: '赵日天',
92
-          disable: '赵日地',
93
-          permission: '赵日天',
94
-          createTime: '赵爸爸'
95
-        }, {
96
-          role: '赵日天',
97
-          roleName: '赵日天',
98
-          disable: '赵日地',
99
-          permission: '赵日天',
100
-          createTime: '赵爸爸'
101
-        }, {
102
-          role: '赵日天',
103
-          roleName: '赵日天',
104
-          disable: '赵日地',
105
-          permission: '赵日天',
106
-          createTime: '赵爸爸'
107
-        }, {
108
-          role: '赵日天',
109
-          roleName: '赵日天',
110
-          disable: '赵日地',
111
-          permission: '赵日天',
112
-          createTime: '赵爸爸'
113
-        }
114
-      ],
115
-      treeData: [{
116
-        label: '根目录',
117
-        rank: '0',
118
-        img: '',
119
-        children: [{
120
-          label: '共享课程&书吧',
121
-          rank: '0',
122
-          img: '',
123
-          children: [{
124
-            label: '健身',
125
-            rank: '0',
126
-            img: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/163306109741.png',
127
-          }, {
128
-            label: '健康',
129
-            rank: '0',
130
-            img: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/163325263583.png',
131
-          }, {
132
-            label: '艺术',
133
-            rank: '0',
134
-            img: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/104118813781.png',
135
-          }, {
136
-            label: '社交',
137
-            rank: '0',
138
-            img: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/163339496588.png',
139
-          }, {
140
-            label: '教育',
141
-            rank: '0',
142
-            img: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/163351586373.png',
143
-          }]
144
-        }]
145
-      }]
146 67
     }
147 68
   },
69
+  computed: {
70
+    ...mapRoleState({
71
+      roles: x => x.roleList,
72
+    }),
73
+  },
148 74
   components: {
149 75
     tableSearch
150 76
   },
151 77
   methods: {
78
+    ...mapRoleActions([
79
+      'GetRolesList',
80
+    ]),
81
+    FormatDate (date) {
82
+      return date
83
+    },
152 84
     handleSizeChange (val) {
153 85
       console.log(`每页 ${val} 条`)
154 86
     },
@@ -198,7 +130,10 @@ export default {
198 130
     getCheckedNodes () { // 获取选中的节点
199 131
       console.log(this.$refs.tree.getCheckedNodes())
200 132
     }
201
-  }
133
+  },
134
+  beforeMount () {
135
+    this.GetRolesList()
136
+  },
202 137
 }
203 138
 </script>
204 139
 

+ 3
- 1
src/store/index.js Прегледај датотеку

@@ -7,13 +7,15 @@ Vue.use(Vuex)
7 7
 const store = new Vuex.Store({
8 8
   state: {
9 9
     loadding: false,
10
+    pageSize: 10,
10 11
   }
11 12
 })
12 13
 Vuex.Store.prototype.$api = api
13 14
 Vuex.Store.prototype.$ajax = Ajax
14 15
 export const modules = {
15 16
   app: () => require('./app').default,
16
-  cms: () => require('./cms').default
17
+  cms: () => require('./cms').default,
18
+  role: () => require('./system/role').default,
17 19
 }
18 20
 
19 21
 Object.keys(modules).forEach((modKey) => {

+ 65
- 0
src/store/system/role.js Прегледај датотеку

@@ -0,0 +1,65 @@
1
+import ajax from '../../util/ajax'
2
+import api from '../../util/api'
3
+
4
+export default {
5
+  namespaced: true,
6
+  state: {
7
+    roleList: [],
8
+    roleInfo: {},
9
+  },
10
+  mutations: {
11
+    updateList (state, payload) {
12
+      state.roleList = payload || []
13
+    },
14
+    updateInfo (state, payload) {
15
+      state.roleInfo = payload || []
16
+    },
17
+  },
18
+  actions: {
19
+    GetRolesList ({ commit }) {
20
+      ajax(api.role.list.url, {
21
+        method: api.role.list.method
22
+      }).then(res => {
23
+        commit('updateList', res)
24
+      })
25
+    },
26
+    GetRoleByID ({ commit }, { roleid }) {
27
+      ajax(api.role.info.url, {
28
+        method: api.role.info.method,
29
+        urlData: {
30
+          id: roleid,
31
+        }
32
+      }).then(res => {
33
+        commit('updateInfo', res)
34
+      })
35
+    },
36
+    AddRole ({ commit }, payload) {
37
+      ajax(api.role.add.url, {
38
+        method: api.role.add.method,
39
+        data: {
40
+          ...payload
41
+        }
42
+      }).then(res => {
43
+        commit('updateInfo', res)
44
+      })
45
+    },
46
+    UpdateRole ({ commit }, payload) {
47
+      ajax(api.role.update.url, {
48
+        method: api.role.update.method,
49
+        data: {
50
+          ...payload
51
+        }
52
+      }).then(res => {
53
+      })
54
+    },
55
+    DelRole ({ commit }, payload) {
56
+      ajax(api.role.delete.url, {
57
+        method: api.role.delete.method,
58
+        data: {
59
+          ...payload
60
+        }
61
+      }).then(res => {
62
+      })
63
+    }
64
+  }
65
+}

+ 77
- 52
src/util/api.js Прегледај датотеку

@@ -1,222 +1,247 @@
1 1
 const baseUrl = '/api'
2
+const common = '/common'
3
+const guest = '/guest'
4
+
2 5
 const $api = {
3 6
   login: { // 登陆
4 7
     signin: {
5 8
       method: 'post',
6
-      url: `${baseUrl}/guest/signin`
9
+      url: `${baseUrl}${guest}/signin`
7 10
     }
8 11
   },
9 12
   system: {
10 13
     init: { // 初始化菜单
11 14
       method: 'get',
12
-      url: `${baseUrl}/common/system/init`
15
+      url: `${baseUrl}${common}/system/init`
13 16
     }
14 17
   },
15 18
   channelManager: {
16 19
     getChannelList: { // 渠道列表
17 20
       method: 'get',
18
-      url: `${baseUrl}/common/`
21
+      url: `${baseUrl}${common}/`
19 22
     },
20 23
   },
21 24
   caseManager: {
22 25
     getCaseList: { // 获取案场列表
23 26
       method: 'get',
24
-      url: `${baseUrl}/common/case/info`
27
+      url: `${baseUrl}${common}/case/info`
25 28
     },
26 29
     addCase: { // 新增案场
27 30
       method: 'post',
28
-      url: `${baseUrl}/common/case/info`
31
+      url: `${baseUrl}${common}/case/info`
29 32
     },
30 33
     getCaseInfo: { // 查询案场
31 34
       method: 'get',
32
-      url: `${baseUrl}/common/case/info/:id`
35
+      url: `${baseUrl}${common}/case/info/:id`
33 36
     },
34 37
     editCase: { // 编辑案场
35 38
       method: 'put',
36
-      url: `${baseUrl}/common/case/info/:id`
39
+      url: `${baseUrl}${common}/case/info/:id`
37 40
     },
38 41
     getKeyList: { // 获取钥匙列表
39 42
       method: 'get',
40
-      url: `${baseUrl}/common/case/key`
43
+      url: `${baseUrl}${common}/case/key`
41 44
     },
42 45
     addKey: { // 新增钥匙
43 46
       method: 'post',
44
-      url: `${baseUrl}/common/case/key`
47
+      url: `${baseUrl}${common}/case/key`
45 48
     },
46 49
     cancelKey: { // 取消钥匙
47 50
       method: 'put',
48
-      url: `${baseUrl}/common/case/unlock/:id`
51
+      url: `${baseUrl}${common}/case/unlock/:id`
49 52
     },
50 53
     getCaseAreaList: { // 获取案场区域列表
51 54
       method: 'get',
52
-      url: `${baseUrl}/common/case/area`
55
+      url: `${baseUrl}${common}/case/area`
53 56
     },
54 57
     addCaseArea: { // 新增案场区域
55 58
       method: 'post',
56
-      url: `${baseUrl}/common/case/area`
59
+      url: `${baseUrl}${common}/case/area`
57 60
     },
58 61
     deleteCaseArea: { // 删除案场区域
59 62
       method: 'delete',
60
-      url: `${baseUrl}/common/case/area/:id`
63
+      url: `${baseUrl}${common}/case/area/:id`
61 64
     },
62 65
     getCaseAreaInfo: { // 获取案场区域信息
63 66
       method: 'get',
64
-      url: `${baseUrl}/common/case/area/:id`
67
+      url: `${baseUrl}${common}/case/area/:id`
65 68
     },
66 69
     editCaseArea: { // 更新案场区域信息
67 70
       method: 'put',
68
-      url: `${baseUrl}/common/case/area`
71
+      url: `${baseUrl}${common}/case/area`
69 72
     },
70 73
     getCaseTableList: { // 获取案场桌位列表
71 74
       method: 'get',
72
-      url: `${baseUrl}/common/case/table`
75
+      url: `${baseUrl}${common}/case/table`
73 76
     },
74 77
     addCaseTable: { // 新增案场桌位
75 78
       method: 'post',
76
-      url: `${baseUrl}/common/case/table`
79
+      url: `${baseUrl}${common}/case/table`
77 80
     },
78 81
     getCaseTableInfo: { // 查询案场桌位信息
79 82
       method: 'get',
80
-      url: `${baseUrl}/common/case/table/:id`
83
+      url: `${baseUrl}${common}/case/table/:id`
81 84
     },
82 85
     editCaseTable: { // 更新案场桌位信息
83 86
       method: 'put',
84
-      url: `${baseUrl}/common/case/table`
87
+      url: `${baseUrl}${common}/case/table`
85 88
     },
86 89
     deleteCaseTable: { // 删除案场桌位信息
87 90
       method: 'delete',
88
-      url: `${baseUrl}/common/case/table/:id`
91
+      url: `${baseUrl}${common}/case/table/:id`
89 92
     },
90 93
     getCaseTagList: { // 获取案场标签列表
91 94
       method: 'get',
92
-      url: `${baseUrl}/common/case/tag`
95
+      url: `${baseUrl}${common}/case/tag`
93 96
     },
94 97
     addCaseTag: { // 新增案场标签
95 98
       method: 'post',
96
-      url: `${baseUrl}/common/case/tag`
99
+      url: `${baseUrl}${common}/case/tag`
97 100
     },
98 101
     getTagInfo: { // 获取案场标签信息
99 102
       method: 'get',
100
-      url: `${baseUrl}/common/case/tag/:id`
103
+      url: `${baseUrl}${common}/case/tag/:id`
101 104
     },
102 105
     deleteCaseTag: { // 删除案场标签
103 106
       method: 'delete',
104
-      url: `${baseUrl}/common/case/tag/:id`
107
+      url: `${baseUrl}${common}/case/tag/:id`
105 108
     },
106 109
   },
107 110
   goodsManager: {
108 111
     getGoodsSpecList: { // 商品规格列表
109 112
       method: 'get',
110
-      url: `${baseUrl}/common/spec/goods`
113
+      url: `${baseUrl}${common}/spec/goods`
111 114
     },
112 115
     addGoodsSpec: { // 新增商品规格
113 116
       method: 'post',
114
-      url: `${baseUrl}/common/spec/goods`
117
+      url: `${baseUrl}${common}/spec/goods`
115 118
     },
116 119
     getGoodsSpecById: { // 根据id获取商品规格
117 120
       method: 'get',
118
-      url: `${baseUrl}/common/spec/goods/:id`
121
+      url: `${baseUrl}${common}/spec/goods/:id`
119 122
     },
120 123
     editGoodsSpec: { // 编辑商品规格
121 124
       method: 'put',
122
-      url: `${baseUrl}/common/spec/goods/:id`
125
+      url: `${baseUrl}${common}/spec/goods/:id`
123 126
     },
124 127
     deleteGoodsSpec: { // 删除商品规格
125 128
       method: 'delete',
126
-      url: `${baseUrl}/common/spec/goods/:id`
129
+      url: `${baseUrl}${common}/spec/goods/:id`
127 130
     },
128 131
     getGoodsTypeList: { // 商品种类列表
129 132
       method: 'get',
130
-      url: `${baseUrl}/common/type/goods`
133
+      url: `${baseUrl}${common}/type/goods`
131 134
     },
132 135
     addGoodsType: { // 新增商品种类
133 136
       method: 'post',
134
-      url: `${baseUrl}/common/type/goods`
137
+      url: `${baseUrl}${common}/type/goods`
135 138
     },
136 139
     getGoodsTypeById: { // 根据id获取商品种类
137 140
       method: 'get',
138
-      url: `${baseUrl}/common/type/goods/:id`
141
+      url: `${baseUrl}${common}/type/goods/:id`
139 142
     },
140 143
     editGoodsType: { // 编辑商品种类
141 144
       method: 'put',
142
-      url: `${baseUrl}/common/type/goods/:id`
145
+      url: `${baseUrl}${common}/type/goods/:id`
143 146
     },
144 147
     deleteGoodsType: { // 删除商品种类
145 148
       method: 'delete',
146
-      url: `${baseUrl}/common/type/goods/:id`
149
+      url: `${baseUrl}${common}/type/goods/:id`
147 150
     },
148 151
   },
149 152
   cms: {
150 153
     location: { // 图片位置
151 154
       method: 'get',
152
-      url: `${baseUrl}/common/cms/location`
155
+      url: `${baseUrl}${common}/cms/location`
153 156
     },
154 157
     imageList: { // 轮播图列表
155 158
       method: 'get',
156
-      url: `${baseUrl}/common/cms/image`
159
+      url: `${baseUrl}${common}/cms/image`
157 160
     },
158 161
     imageDetail: { // 轮播图详情
159 162
       method: 'get',
160
-      url: `${baseUrl}/common/cms/image/:id`
163
+      url: `${baseUrl}${common}/cms/image/:id`
161 164
     },
162 165
     addImage: { // 添加轮播图
163 166
       method: 'post',
164
-      url: `${baseUrl}/common/cms/image`
167
+      url: `${baseUrl}${common}/cms/image`
165 168
     },
166 169
     editImage: { // 编辑轮播图
167 170
       method: 'put',
168
-      url: `${baseUrl}/common/cms/image/:id`
171
+      url: `${baseUrl}${common}/cms/image/:id`
169 172
     },
170 173
     deleteDetail: { // 删除轮播图
171 174
       method: 'delete',
172
-      url: `${baseUrl}/common/cms/image/:id`
175
+      url: `${baseUrl}${common}/cms/image/:id`
173 176
     },
174 177
     case: { // 首页案场列表
175 178
       method: 'get',
176
-      url: `${baseUrl}/common/cms/case`
179
+      url: `${baseUrl}${common}/cms/case`
177 180
     },
178 181
     caseDetail: { // 首页案场详情
179 182
       method: 'get',
180
-      url: `${baseUrl}/common/cms/case/:id`
183
+      url: `${baseUrl}${common}/cms/case/:id`
181 184
     },
182 185
     addCase: { // 添加首页案场
183 186
       method: 'post',
184
-      url: `${baseUrl}/common/cms/case`
187
+      url: `${baseUrl}${common}/cms/case`
185 188
     },
186 189
     editCase: { // 添加首页案场
187 190
       method: 'put',
188
-      url: `${baseUrl}/common/cms/case/:id`
191
+      url: `${baseUrl}${common}/cms/case/:id`
189 192
     },
190 193
     deleteCase: { // 添加首页案场
191 194
       method: 'delete',
192
-      url: `${baseUrl}/common/cms/case/:id`
195
+      url: `${baseUrl}${common}/cms/case/:id`
193 196
     },
194 197
     info: { // 首页消息列表
195 198
       method: 'get',
196
-      url: `${baseUrl}/common/cms/info`
199
+      url: `${baseUrl}${common}/cms/info`
197 200
     },
198 201
     infoDetail: { // 首页消息详情
199 202
       method: 'get',
200
-      url: `${baseUrl}/common/cms/info/:id`
203
+      url: `${baseUrl}${common}/cms/info/:id`
201 204
     },
202 205
     addInfo: { // 新增首页消息
203 206
       method: 'post',
204
-      url: `${baseUrl}/common/cms/info`
207
+      url: `${baseUrl}${common}/cms/info`
205 208
     },
206 209
     editInfo: { // 编辑首页消息
207 210
       method: 'put',
208
-      url: `${baseUrl}/common/cms/info/:id`
211
+      url: `${baseUrl}${common}/cms/info/:id`
209 212
     },
210 213
     deleteInfo: { // 编辑首页消息
211 214
       method: 'delete',
212
-      url: `${baseUrl}/common/cms/info/:id`
215
+      url: `${baseUrl}${common}/cms/info/:id`
213 216
     }
214 217
   },
215 218
   file: {
216 219
     image: { // 图片上传
217 220
       method: 'post',
218
-      url: `${baseUrl}/common/file`
221
+      url: `${baseUrl}${common}/file`
219 222
     }
220
-  }
223
+  },
224
+  role: {
225
+    list: {
226
+      method: 'get',
227
+      url: `${baseUrl}${common}/role`
228
+    },
229
+    info: {
230
+      method: 'get',
231
+      url: `${baseUrl}${common}/role/:id`
232
+    },
233
+    add: {
234
+      method: 'post',
235
+      url: `${baseUrl}${common}/role`
236
+    },
237
+    update: {
238
+      method: 'put',
239
+      url: `${baseUrl}${common}/role`
240
+    },
241
+    delete: {
242
+      method: 'delete',
243
+      url: `${baseUrl}${common}/role/:id`
244
+    },
245
+  },
221 246
 }
222 247
 export default $api