wangfei 6 years ago
parent
commit
427331913b

+ 29
- 62
src/pages/system/systemSet/roleManager/add.vue View File

2
   <div class="subPage">
2
   <div class="subPage">
3
     <form class="mainForm">
3
     <form class="mainForm">
4
       <ul>
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
         <li class="flex-h">
5
         <li class="flex-h">
18
           <span>角色名称:</span>
6
           <span>角色名称:</span>
19
           <div class="flex-item">
7
           <div class="flex-item">
20
             <div style="width:50%">
8
             <div style="width:50%">
21
               <el-input
9
               <el-input
22
                 placeholder="请输入角色名称"
10
                 placeholder="请输入角色名称"
23
-                v-model="postData.roleName"
11
+                v-model="detail.RoleName"
24
                 clearable>
12
                 clearable>
25
               </el-input>
13
               </el-input>
26
             </div>
14
             </div>
27
           </div>
15
           </div>
28
         </li>
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
         <li class="flex-h">
17
         <li class="flex-h">
57
           <span>备注:</span>
18
           <span>备注:</span>
58
           <div class="flex-item">
19
           <div class="flex-item">
61
                 placeholder="请输入备注"
22
                 placeholder="请输入备注"
62
                 type="textarea"
23
                 type="textarea"
63
                 :autosize="{ minRows: 3, maxRows: 5}"
24
                 :autosize="{ minRows: 3, maxRows: 5}"
64
-                v-model="postData.remark"
25
+                v-model="detail.Remark"
65
                 clearable>
26
                 clearable>
66
               </el-input>
27
               </el-input>
67
             </div>
28
             </div>
77
 </template>
38
 </template>
78
 
39
 
79
 <script>
40
 <script>
41
+import { createNamespacedHelpers, mapState } from 'vuex'
42
+
43
+const { mapState: mapRoleState, mapActions: mapRoleActions } = createNamespacedHelpers('role')
80
 export default {
44
 export default {
81
   name: '',
45
   name: '',
82
   data () {
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
   components: {},
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
   methods: {
59
   methods: {
60
+    ...mapRoleActions([
61
+      'GetRoleByID',
62
+      'AddRole',
63
+      'UpdateRole',
64
+    ]),
105
     submit () {
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
     cancel () {
74
     cancel () {
109
       this.$router.go(-1)
75
       this.$router.go(-1)
110
     }
76
     }
111
   },
77
   },
112
-  mounted () { }
78
+  beforeMount () {
79
+  }
113
 }
80
 }
114
 </script>
81
 </script>
115
 
82
 

+ 0
- 51
src/pages/system/systemSet/roleManager/edit.vue View File

2
   <div class="subPage">
2
   <div class="subPage">
3
     <form class="mainForm">
3
     <form class="mainForm">
4
       <ul>
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
         <li class="flex-h">
5
         <li class="flex-h">
18
           <span>角色名称:</span>
6
           <span>角色名称:</span>
19
           <div class="flex-item">
7
           <div class="flex-item">
26
             </div>
14
             </div>
27
           </div>
15
           </div>
28
         </li>
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
         <li class="flex-h">
17
         <li class="flex-h">
57
           <span>备注:</span>
18
           <span>备注:</span>
58
           <div class="flex-item">
19
           <div class="flex-item">
84
       postData: {
45
       postData: {
85
         roleId: '', // 角色名
46
         roleId: '', // 角色名
86
         roleName: '', // 角色姓名
47
         roleName: '', // 角色姓名
87
-        disable: false, // 禁用角色
88
-        permission: '', // 数据权限
89
         remark: '' // 备注
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
   components: {},
52
   components: {},

+ 30
- 95
src/pages/system/systemSet/roleManager/index.vue View File

10
       <div class="moreFilter"></div>
10
       <div class="moreFilter"></div>
11
     </div>
11
     </div>
12
     <div class="system-table-box">
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
         </el-table-column>
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
         </el-table-column>
17
         </el-table-column>
24
         <el-table-column fixed='right' label="操作" width="300">
18
         <el-table-column fixed='right' label="操作" width="300">
25
           <template slot-scope="scope">
19
           <template slot-scope="scope">
30
         </el-table-column>
24
         </el-table-column>
31
       </el-table>
25
       </el-table>
32
     </div>
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
     </el-pagination>
34
     </el-pagination>
35
-    <el-dialog title="请选择机构" :visible.sync="dialogTableVisible">
35
+    <!-- <el-dialog title="请选择机构" :visible.sync="dialogTableVisible">
36
       <el-tree
36
       <el-tree
37
         class="flxe-h"
37
         class="flxe-h"
38
         :data="treeData"
38
         :data="treeData"
44
         <div class="flex-h" style="justify-content: flex-end;margin-top: 1rem">
44
         <div class="flex-h" style="justify-content: flex-end;margin-top: 1rem">
45
           <el-button type='success' @click="getCheckedNodes">确定</el-button>
45
           <el-button type='success' @click="getCheckedNodes">确定</el-button>
46
         </div>
46
         </div>
47
-    </el-dialog>
47
+    </el-dialog> -->
48
   </div>
48
   </div>
49
 </template>
49
 </template>
50
 
50
 
51
 <script>
51
 <script>
52
+import { createNamespacedHelpers } from 'vuex'
52
 import tableSearch from '@/components/tableSearch/index'
53
 import tableSearch from '@/components/tableSearch/index'
53
 
54
 
55
+const { mapState: mapRoleState, mapActions: mapRoleActions } = createNamespacedHelpers('role')
56
+
54
 export default {
57
 export default {
55
   name: '',
58
   name: '',
56
   data () {
59
   data () {
61
         key: '111' // 搜索关键字
64
         key: '111' // 搜索关键字
62
       },
65
       },
63
       dialogTableVisible: false,
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
   components: {
74
   components: {
149
     tableSearch
75
     tableSearch
150
   },
76
   },
151
   methods: {
77
   methods: {
78
+    ...mapRoleActions([
79
+      'GetRolesList',
80
+    ]),
81
+    FormatDate (date) {
82
+      return date
83
+    },
152
     handleSizeChange (val) {
84
     handleSizeChange (val) {
153
       console.log(`每页 ${val} 条`)
85
       console.log(`每页 ${val} 条`)
154
     },
86
     },
198
     getCheckedNodes () { // 获取选中的节点
130
     getCheckedNodes () { // 获取选中的节点
199
       console.log(this.$refs.tree.getCheckedNodes())
131
       console.log(this.$refs.tree.getCheckedNodes())
200
     }
132
     }
201
-  }
133
+  },
134
+  beforeMount () {
135
+    this.GetRolesList()
136
+  },
202
 }
137
 }
203
 </script>
138
 </script>
204
 
139
 

+ 3
- 1
src/store/index.js View File

7
 const store = new Vuex.Store({
7
 const store = new Vuex.Store({
8
   state: {
8
   state: {
9
     loadding: false,
9
     loadding: false,
10
+    pageSize: 10,
10
   }
11
   }
11
 })
12
 })
12
 Vuex.Store.prototype.$api = api
13
 Vuex.Store.prototype.$api = api
13
 Vuex.Store.prototype.$ajax = Ajax
14
 Vuex.Store.prototype.$ajax = Ajax
14
 export const modules = {
15
 export const modules = {
15
   app: () => require('./app').default,
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
 Object.keys(modules).forEach((modKey) => {
21
 Object.keys(modules).forEach((modKey) => {

+ 65
- 0
src/store/system/role.js View File

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 View File

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