提交 | 用户 | 时间
|
e7c126
|
1 |
import request from '@/utils/request'
|
H |
2 |
|
|
3 |
// 创建分类
|
|
4 |
export function createCategory(data) {
|
|
5 |
return request({
|
|
6 |
url: '/infra/category/create',
|
|
7 |
method: 'post',
|
|
8 |
data: data
|
|
9 |
})
|
|
10 |
}
|
|
11 |
|
|
12 |
// 更新分类
|
|
13 |
export function updateCategory(data) {
|
|
14 |
return request({
|
|
15 |
url: '/infra/category/update',
|
|
16 |
method: 'put',
|
|
17 |
data: data
|
|
18 |
})
|
|
19 |
}
|
|
20 |
|
|
21 |
// 删除分类
|
|
22 |
export function deleteCategory(id) {
|
|
23 |
return request({
|
|
24 |
url: '/infra/category/delete?id=' + id,
|
|
25 |
method: 'delete'
|
|
26 |
})
|
|
27 |
}
|
|
28 |
|
|
29 |
// 获得分类
|
|
30 |
export function getCategory(id) {
|
|
31 |
return request({
|
|
32 |
url: '/infra/category/get?id=' + id,
|
|
33 |
method: 'get'
|
|
34 |
})
|
|
35 |
}
|
|
36 |
|
|
37 |
// 获得分类列表
|
|
38 |
export function getCategoryList(params) {
|
|
39 |
return request({
|
|
40 |
url: '/infra/category/list',
|
|
41 |
method: 'get',
|
|
42 |
params
|
|
43 |
})
|
|
44 |
}
|
|
45 |
// 导出分类 Excel
|
|
46 |
export function exportCategoryExcel(params) {
|
|
47 |
return request({
|
|
48 |
url: '/infra/category/export-excel',
|
|
49 |
method: 'get',
|
|
50 |
params,
|
|
51 |
responseType: 'blob'
|
|
52 |
})
|
|
53 |
}
|