|
@@ -35,12 +35,18 @@ window.uploadFile = async function ({ file, uuid, userid, folderid, moFolderid }
|
|
|
fid: folderid,
|
|
|
mofid: moFolderid !== folderid ? moFolderid : ""
|
|
|
};
|
|
|
+ const encoded = {};
|
|
|
+ for (const key in params) {
|
|
|
+ if (Object.hasOwnProperty.call(params, key)) {
|
|
|
+ encoded[key] = encodeURIComponent(params[key]);
|
|
|
+ }
|
|
|
+ }
|
|
|
const res2 = await fetch('https://pbl.cocorobo.cn/api/pbl/addFile', {
|
|
|
method: 'POST',
|
|
|
headers: {
|
|
|
'Content-Type': 'application/x-www-form-urlencoded'
|
|
|
},
|
|
|
- body: JSON.stringify([params])
|
|
|
+ body: new URLSearchParams(encoded).toString()
|
|
|
});
|
|
|
console.log("上传成功");
|
|
|
return { code: 200, msg: "上传成功" }
|