43 lines
1.1 KiB
JavaScript
43 lines
1.1 KiB
JavaScript
import {http2} from "@/utils/request.js";
|
|
/**获取文件列表 */
|
|
export const getFileList = (params) => {
|
|
return http2.get('/api/v1/admin/file/list',{params})
|
|
}
|
|
|
|
/**获取文件详情 */
|
|
export const getFileDetail = (data) => {
|
|
return http2.get('/api/v1/admin/file/detail?file_id='+data.file_id)
|
|
}
|
|
|
|
/**删除文件 */
|
|
export const deleteFile = (data) => {
|
|
return http2.delete('/api/v1/admin/file/delete', {
|
|
params: data
|
|
})
|
|
}
|
|
/**修改文件信息 */
|
|
export const updateFile = (data) => {
|
|
return http2.post('/api/v1/admin/file/update', data,{
|
|
headers:{
|
|
'Content-Type':'multipart/form-data'
|
|
}
|
|
})
|
|
}
|
|
/**公共接口 获取文件信息 */
|
|
export const getFile = (data) => {
|
|
return http2.get('/api/v1/tools/file/info?file_id='+data.file_id)
|
|
}
|
|
|
|
/**文件上传 */
|
|
export const uploadFile = (data) => {
|
|
return http2.post('/api/v1/tools/file/upload', data,{
|
|
headers:{
|
|
'Content-Type':'multipart/form-data'
|
|
}
|
|
})
|
|
}
|
|
/**文件下载 */
|
|
export const downloadFile = (data) => {
|
|
return http2.get('/api/v1/tool/file/down?file_id='+data.file_id)
|
|
}
|