role.js
600 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import request from '@/utils/request'
export function getRoutes() {
return request({
url: '/yp/routes',
method: 'get'
})
}
export function getRoles() {
return request({
url: '/yp/roles',
method: 'get'
})
}
export function addRole(data) {
return request({
url: '/yp/role',
method: 'post',
data
})
}
export function updateRole(id, data) {
return request({
url: `/vue-element-admin/role/${id}`,
method: 'put',
data
})
}
export function deleteRole(id) {
return request({
url: `/vue-element-admin/role/${id}`,
method: 'delete'
})
}