上传文件有token的时候,添加token

This commit is contained in:
2025-05-13 16:41:48 +08:00
parent 13216d3518
commit ddd3dd981a
7 changed files with 846 additions and 332 deletions

View File

@ -269,14 +269,14 @@ export function menuJump(item) {
}
}
export function uploadFile(path) {
export function uploadFile(path, token = '') {
return new Promise((resolve, reject) => {
uni.uploadFile({
url: `${baseURL}/api/file/formimage`,
filePath: path,
name: "file",
header: {
token: store.getters.token,
token: store.getters.token || token,
},
fileType: "image",
cloudPath: "",