mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-12 21:53:48 +08:00
v3.0.0
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 文件上传
|
||||
*
|
||||
* @Author: 1024创新实验室-主任:卓大
|
||||
* @Date: 2022-09-03 21:55:25
|
||||
* @Wechat: zhuda1024
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { postRequest, getRequest, getDownload } from '/src/lib/axios';
|
||||
|
||||
export const fileApi = {
|
||||
// 文件上传 @author 卓大
|
||||
uploadUrl: '/support/file/upload',
|
||||
uploadFile: (param, folder) => {
|
||||
return postRequest(`/support/file/upload?folder=${folder}`, param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 分页查询 @author 卓大
|
||||
*/
|
||||
queryPage: (param) => {
|
||||
return postRequest('/support/file/queryPage', param);
|
||||
},
|
||||
/**
|
||||
* 获取文件URL:根据fileKey @author 胡克
|
||||
*/
|
||||
getUrl: (fileKey) => {
|
||||
return getRequest(`/support/file/getFileUrl?fileKey=${fileKey}`);
|
||||
},
|
||||
|
||||
/**
|
||||
* 下载文件流(根据fileKey) @author 胡克
|
||||
*/
|
||||
downLoadFile: (fileName, fileKey) => {
|
||||
return getDownload(fileName, '/support/file/downLoad', { fileKey });
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user