添加上传全局提示

This commit is contained in:
GGJ
2025-12-15 10:35:34 +08:00
parent 9f5b2ecc46
commit 6918611d06

View File

@@ -1,5 +1,5 @@
import createAxios from '@/utils/request' import createAxios from '@/utils/request'
import { ElMessage } from 'element-plus'
const SYSTEM_PREFIX = '/system-boot' const SYSTEM_PREFIX = '/system-boot'
/** /**
@@ -17,6 +17,11 @@ export const uploadFile = (file: any, path: string) => {
'Content-Type': 'multipart/form-data' 'Content-Type': 'multipart/form-data'
}, },
data: form data: form
}).then(res => {
if (res.code == `A0000`) {
ElMessage.success('上传成功!')
return res
}
}) })
} }
@@ -50,7 +55,7 @@ export const downloadFile = (filePath: any) => {
/** /**
* 获取文件的短期url展示 * 获取文件的短期url展示
*/ */
export const getFileUrl = (params:any) => { export const getFileUrl = (params: any) => {
let form = new FormData() let form = new FormData()
// form.append('filePath', filePath) // form.append('filePath', filePath)
return createAxios({ return createAxios({