修复上传没传递用户的问题
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user