- 上传提示fail createUploadTask:fail file not found?
相同的上传代码,为什么使用we-cropper头像截图错误提示找不到文件? const uploadFile = async (url, { name = "file", filePath, formData = { type: "picture", uid: wx.getStorageSync('userInfo') ? wx.getStorageSync('userInfo').uid:"" }, } = {}) => { console.log(filePath)// url = formatUrl(url) try { let res = await wx.pro.uploadFile({ url, filePath: filePath, name, formData }) console.log(name) console.log(filePath) console.log(url) console.log(formData) console.log(res) //网络请求错误 if (res.statusCode != 200) { throw res; } let data = JSON.parse(res.data) //服务器提示错误 if (data.code != 0) { throw res; } return data.data } catch (e) { console.log(name) console.log(filePath) console.log(url) console.log(formData) console.log(e) util.hideAll() if (e.statusCode!=200){ util.networkError(e.statusCode) }else{ let data = JSON.parse(e.data) let { code, msg } = data if (code == -2) { let { confirm } = await wx.pro.showModal({ title: '权限不足', content: msg, confirmText: "去开通" }) if (confirm) util.goUrl('/pages/ucenter/member/member'); }else{ util.showFail(msg) } } return await Promise.reject(e); } } [图片] 非we-cropper上传的log: q.js? [sm]:218 http://tmp/sdn5KxOt3CMo9b3902b3b62cbf33d9c05132d51cfa9c.png q.js? [sm]:222 file q.js? [sm]:223 http://tmp/sdn5KxOt3CMo9b3902b3b62cbf33d9c05132d51cfa9c.png q.js? [sm]:224 https://API.XXXXXX.COM/API.php?i=1 q.js? [sm]:225 {type: "picture", uid: 9} 使用we-cropper上传的log: q.js? [sm]:218 http://tmp/R7LDSTKDpB5Z748f7e39d6a2252cf16409ba0f050069.jpg q.js? [sm]:235 file q.js? [sm]:236 http://tmp/R7LDSTKDpB5Z748f7e39d6a2252cf16409ba0f050069.jpg q.js? [sm]:237 https://API.XXXXXX.COM/API.php?i=1 q.js? [sm]:238 {type: "picture", uid: 4} q.js? [sm]:239 {errMsg: "uploadFile:fail createUploadTask:fail file not found"}
2022-04-30 - 为什么突然获取ticket超级慢?
移动端突然访问超级慢,不知道是什么问题!经过排查是因为curl_exec($curl)获取ticket要几十秒时间,curl_getinfo($curl)打印了一下信息如下: array(26) { ["url"] => string(232) "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=43_mN9vHz-KwpR8WG************************************V8U3zfNMuCUz4-87KhRPhpH7IRxl***********************D0pEllsjhbCU1nw-R9acjaU-VSEDjAFAVHG&type=jsapi" ["content_type"] => string(32) "application/json; encoding=utf-8" ["http_code"] => int(200) ["header_size"] => int(149) ["request_size"] => int(262) ["filetime"] => int(-1) ["ssl_verify_result"] => int(0) ["redirect_count"] => int(0) ["total_time"] => float(12.62799) ["namelookup_time"] => float(0.000254) ["connect_time"] => float(0.331384) ["pretransfer_time"] => float(12.14724) ["size_upload"] => float(0) ["size_download"] => float(143) ["speed_download"] => float(11) ["speed_upload"] => float(0) ["download_content_length"] => float(143) ["upload_content_length"] => float(-1) ["starttransfer_time"] => float(12.627968) ["redirect_time"] => float(0) ["redirect_url"] => string(0) "" ["primary_ip"] => string(14) "203.205.239.94" ["certinfo"] => array(0) { } ["primary_port"] => int(443) ["local_ip"] => string(13) "172.26.61.196" ["local_port"] => int(33600) } 求教了
2021-03-15 - weapp_template_msg.form_id没有了这个还能用吗?
https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/uniform-message/uniformMessage.send.html
2020-08-17