84 lines
1.7 KiB
JavaScript
84 lines
1.7 KiB
JavaScript
import { fetchSso } from '@/core/request';
|
|
|
|
const headers = { 'token-Type': 'ADMIN' };
|
|
const servicePrefix = 'yygl';
|
|
|
|
export default {
|
|
// 分类列表
|
|
getCategoryList() {
|
|
return fetchSso({
|
|
url: `${servicePrefix}/document/category/list`,
|
|
method: 'get',
|
|
headers,
|
|
});
|
|
},
|
|
// 新增分类
|
|
addCategory(data) {
|
|
return fetchSso({
|
|
url: `${servicePrefix}/document/category`,
|
|
data: JSON.stringify(data),
|
|
method: 'post',
|
|
headers,
|
|
});
|
|
},
|
|
// 编辑分类
|
|
updateCategory(id, data) {
|
|
return fetchSso({
|
|
url: `${servicePrefix}/document/category/${id}`,
|
|
data: JSON.stringify(data),
|
|
method: 'put',
|
|
headers,
|
|
});
|
|
},
|
|
// 删除分类
|
|
deleteCategory(id) {
|
|
return fetchSso({
|
|
url: `${servicePrefix}/document/category/${id}`,
|
|
method: 'delete',
|
|
headers,
|
|
});
|
|
},
|
|
// 文档列表
|
|
getDocumentList(params) {
|
|
return fetchSso({
|
|
url: `${servicePrefix}/document/list`,
|
|
method: 'get',
|
|
params,
|
|
headers,
|
|
});
|
|
},
|
|
// 文档详情
|
|
getDocumentDetail(id) {
|
|
return fetchSso({
|
|
url: `${servicePrefix}/document/${id}`,
|
|
method: 'get',
|
|
headers,
|
|
});
|
|
},
|
|
// 新增文档
|
|
addDocument(data) {
|
|
return fetchSso({
|
|
url: `${servicePrefix}/document`,
|
|
data: JSON.stringify(data),
|
|
method: 'post',
|
|
headers,
|
|
});
|
|
},
|
|
// 编辑文档
|
|
updateDocument(id, data) {
|
|
return fetchSso({
|
|
url: `${servicePrefix}/document/${id}`,
|
|
data: JSON.stringify(data),
|
|
method: 'put',
|
|
headers,
|
|
});
|
|
},
|
|
// 删除文档
|
|
deleteDocument(id) {
|
|
return fetchSso({
|
|
url: `${servicePrefix}/document/${id}`,
|
|
method: 'delete',
|
|
headers,
|
|
});
|
|
},
|
|
}; |