小程序
小游戏
企业微信
微信支付
扫描小程序码分享
问题:request:fail invalid url " https://financial.nesc.cn/financial-shop-server/authImage?r=1546575012159"
描述:
“https://financial.nesc.cn”这个域名是昨天上午申请的,已经过了24个小时了,而且也在后台配置了,但是请求图形验证码的时候还是报这个错,其他接口可以正常请求,换个老的域名也可以请求成功!求解~~~
2 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
多了个空格?
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
空格没有,检查了
console.log("===");
console.log(process.env.API_PATH)
在wx.request前面加上这两行哎,然后截图看下你的console
谢谢,我解决了,图片请求的时候还是多了空格
哦哦 好的哦
怎么请求的?
let that=this;wx.request({ url: process.env.API_PATH+'/financial-shop-server/authImage?r='+(new Date().getTime()), responseType: 'arraybuffer', header: { 'content-type': 'application/json', 'cookie':wx.getStorageSync("sessionId") }, success(res) { res.headers = {} for (let i in res.header) res.headers[i.toLowerCase()] = res.header[i] that.$mgui.updateCookie(res); let base64 = wx.arrayBufferToBase64(res.data); that.authImage = 'data:image/jpg;base64,' + base64 }})
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
多了个空格?
空格没有,检查了
console.log("===");
console.log(process.env.API_PATH)
在wx.request前面加上这两行哎,然后截图看下你的console
谢谢,我解决了,图片请求的时候还是多了空格
哦哦 好的哦
怎么请求的?