forked from liuhll/hero-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrole.js
More file actions
61 lines (52 loc) · 1.13 KB
/
role.js
File metadata and controls
61 lines (52 loc) · 1.13 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import request from '@/utils/request'
import setting from '@/settings'
export const list = (searchKey) => {
if (searchKey == null || searchKey == undefined) {
searchKey = ""
}
return request({
url: `${setting.apiPrefix}/role/list`,
method: 'get',
params: { searchKey: searchKey }
})
}
export const search = query => {
return request({
url: `${setting.apiPrefix}/role/search`,
method: 'post',
data: { query: query }
})
}
export const create = input => {
return request({
url: `${setting.apiPrefix}/role`,
method: 'post',
data: { input: input }
})
}
export const update = input => {
return request({
url: `${setting.apiPrefix}/role`,
method: 'put',
data: { input: input }
})
}
export const updateStatus = input => {
return request({
url: `${setting.apiPrefix}/role/status`,
method: 'put',
data: { input: input }
})
}
export const deleteRole = id => {
return request({
url: `${setting.apiPrefix}/role/${id}`,
method: 'delete'
})
}
export const getRole = id => {
return request({
url: `${setting.apiPrefix}/role/${id}`,
method: 'get'
})
}