smart-admin/smart-admin-web/src/api/file.js
2020-04-20 17:08:42 +08:00

29 lines
889 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { postAxios, getAxios, getDownloadAxios} from '@/lib/http';
import config from '@/config';
const baseUrl = config.baseUrl.apiUrl;
export const fileApi = {
// 系统文件查询
queryFileList: data => {
return postAxios('/api/file/query', data);
},
// 系统文件下载通过接口
downLoadFile: id => {
return getDownloadAxios('/api/file/downLoad?id=' + id);
},
// 文件上传
fileUpload: (type, data) => {
// return postAxios('/api/file/localUpload/' + type, data);
return this.fileUploadUrl;
},
// 文件保存
addFile: data => {
return postAxios('/api/file/save', data);
},
// 上传路径:本地
fileUploadLocalUrl: baseUrl + '/api/file/localUpload/',
// 上传路径阿里OSS
fileUploadAliUrl: baseUrl + '/api/file/aliYunUpload/',
// 上传路径:七牛
fileUploadQiNiuUrl: baseUrl + '/api/file/qiNiuUpload/'
};