yintai-company-home-am/api/common.ts

64 lines
1.3 KiB
TypeScript

import Request from "lib/utils/requests";
// 翻译
export const translateApi = {
translate(params: { text: string, from?: string, to?: string }) {
return Request({
url: "yt/translate",
method: "get",
params,
})
},
}
// 分类
export const categoryApi = {
getDataList(params: any) {
return Request({
url: 'yt/category',
method: 'get',
params
})
},
updateData(params: any) {
return Request({
url: 'yt/category',
method: 'put',
data: params
})
},
deleteData(params: any) {
return Request({
url: 'yt/category',
method: 'delete',
params: params
})
},
addData(params: any) {
return Request({
url: 'yt/category',
method: 'post',
data: params
})
},
}
// 上传
export const uploadApi = {
upload(params: any) {
return Request({
url: 'yt/upload',
method: 'post',
data: params,
params: {
expire: 24 * 30 * 12 * 10,
},
headers: {
"Content-Type": "multipart/form-data",
},
})
},
}