ThinkChat🤖让你学习和工作更高效,注册即送10W Token,即刻开启你的AI之旅 广告
### 操作使用示例 1. 在vue中操作 上传文件 ``` upload(req) { const that = this; const file =req.file; if (file) { let formData = new FormData(); formData.append("file", file.raw); formData.append("name", file.name); that.$txSDK.uploadFile({ filePath: formData }, "post").then(res => { console.log(res)         });      }  }, ``` ***** 2. 在小程序操作 上传文件 ``` upload(){ wx.chooseImage({       count:1,       sizeType: ['original','compressed'],       sourceType: ['album','camera'], success:function(res){ let tempFilePaths=res.tempFilePaths; wx.isSDK.uploadFile({filePath:tempFilePaths[0]}).then(res=>{ console.log(res) }) } }) } ``` ***** ### 数据返回结果示例 ``` { code:200, msg:"成功", data:[ {"url:"https://6761-game-6gaawxc14e1c3be1-1258432851.tcb.qcloud.la/uploadFile/files/weasfsfawea/tmp/s0p6qkQs6l7dA66x9HDBQKey.png""} ] } ``` *****