项目所有的请求都是正常的,在做到个人中心-上传头像时,使用uni.uploadFile进行请求时,发现token被转义了。
正常接口请求URL:
重点看URL中的token
POST http://domain.com/api/Users/Update?appkey=APPKEY&token=F%2F7jyw7ouOlCJOjg5Lt2Qe%2B47Y7QCsCzFcrov3INYQRAtVaMz7tSTOOmGT8DdkPWE9spRyWLEyfc%2BGiF8bhyFfLzBaSGNm2bddMJ666SHB%2F3scHJCR25P9ok3FhPqDq8fjryPir7TKkveqOS5TtElilq3pbYdEcvQF6BQ%2B76OPmkWiSHaVeSIRNqvecDw0zmxf7mDO8TZT3%2FztR72qbugHEoSYbzDNvoPCuoSsjcJSdOJPNoVXAOd16DcjYns2PUHKRTl%2FIHN98oVYCevgK2Rw%3D%3D HTTP/1.1
Content-Type: application/json;charset=UTF-8
Connection: keep-alive
Connection: keep-alive
Accept: */*
User-Agent: iPhone11,8(iOS/14.0) Uninview(Uninview/1.0.0) Weex/0.26.0 828x1792
Content-Length: 1477
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
使用uni.uploadFile上传的URL:
POST http://domain.com/api/Users/UploadUserPhoto?userId=USERID&appkey=APPKEY&token=F/7jyw7ouOlCJOjg5Lt2Qe+47Y7QCsCzFcrov3INYQRAtVaMz7tSTOOmGT8DdkPWE9spRyWLEyfc+GiF8bhyFfLzBaSGNm2bddMJ666SHB/3scHJCR25P9ok3FhPqDq8fjryPir7TKkveqOS5TtElilq3pbYdEcvQF6BQ+76OPmkWiSHaVeSIRNqvecDw0zmxf7mDO8TZT3/ztR72qbugHEoSYbzDNvoPCuoSsjcJSdOJPNoVXAOd16DcjYns2PUHKRTl/IHN98oVYCevgK2Rw== HTTP/1.1
Content-Type: multipart/form-data; boundary=io.dcloud.uploader16028650370818
Connection: keep-alive
Connection: keep-alive
Accept: */*
User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 Html5Plus/1.0 (Immersed/44) uni-app
Content-Length: 1257194
Accept-Language: zh-cn
Accept-Encoding: gzip, deflate
TOKEN在IOS发送请求后被转义回来了,因为发送前先URLEncode过,这个请求在安卓和网页中是正常的,在IOS端就会出现,请问有人知道什么问题,怎么解决吗?
1 个回复
2***@qq.com - 毒蘑菇
请问解决了吗,我现在也遇到这个问题了,ios app中给我自动解码了