修复上传没传递用户的问题

This commit is contained in:
张成
2025-10-20 11:33:56 +08:00
parent 51e103cebc
commit d86df8a5a3

View File

@@ -43,22 +43,10 @@ export interface uploadFileResponseData {
// 发布球局类
class UploadApi {
async upload(req: UploadFilesData): Promise<{ id: string, data: uploadFileResponseData }> {
// return httpService.post('/files/upload', req, {
// showLoading: true,
// })
let fullUrl = `${envConfig.apiBaseURL}/api/gallery/upload`
// 后门id用于调试
let userid = httpService.getHashParam("userIdTest")
if (userid) {
if (fullUrl.indexOf("?") > -1) {
fullUrl += `&userIdTest45=${userid}`
}
else {
fullUrl += `?userIdTest45=${userid}`
}
}
const authHeader = tokenManager.getAuthHeader()
const { id, ...rest } = req
return Taro.uploadFile({
url: fullUrl,
@@ -68,7 +56,8 @@ class UploadApi {
description: rest.description,
tags: rest.tags,
is_public: rest.is_public,
}
},
header: authHeader,
}).then(res => {
return {
id,