uniappx中在使用uni-app uni.request中的header设置了一个{'Tenant-Id':1}的请求头,在小程序中生效了,但安卓中没传递给后端
uniappx中在使用uni-app uni.request中的header设置了一个{‘Tenant-Id’:1}的请求头,在小程序中生效了,但安卓中没传递给后端
| 项目信息 | 详细信息 |
|---|---|
| 产品分类 | uniapp/App |
| PC开发环境操作系统 | Windows |
| PC开发环境操作系统版本号 | wu |
| HBuilderX类型 | 正式 |
| HBuilderX版本号 | 4.76 |
| 手机系统 | Android |
| 手机系统版本号 | Android 16 |
| 手机厂商 | 华为 |
| 手机机型 | 模拟器 |
| 页面类型 | vue |
| vue版本 | vue3 |
| 打包方式 | 云端 |
| 项目创建方式 | HBuilderX |
示例代码:
function aaa<T>(data:Login):Promise<LoginInfo|null>{
return new Promise((resolve,reject)=>{
const header:UTSJSONObject = {
'Tenant-Id': '1'
}
const options:RequestOptions<any> = {
url: (config as configItem).baseUrl + '/system/wx/bind',
method: 'POST',
data: data,
header:header,
success(res:RequestSuccess<Response<T>>){
const obj:LoginInfo={}
console.log(2222222222)
console.log(res, 11111111111)
resolve(res.data?.data as LoginInfo)
},
fail(){
console.log(3333333333333)
// console.log(err)
reject(null)
},
}
console.log(options)
uni.request<Response<T>>(options)
})
}
操作步骤:
无
预期结果:
无
实际结果:
无
bug描述:
uniappx中在使用uni.request中的header设置了一个{‘Tenant-Id’:1}的请求头,在小程序中生效了,但安卓中没传递给后端
更多关于uniappx中在使用uni-app uni.request中的header设置了一个{'Tenant-Id':1}的请求头,在小程序中生效了,但安卓中没传递给后端的实战教程也可以访问 https://www.itying.com/category-93-b0.html
4 回复
data 或者 url 中会有重复的吗?
更多关于uniappx中在使用uni-app uni.request中的header设置了一个{'Tenant-Id':1}的请求头,在小程序中生效了,但安卓中没传递给后端的实战教程也可以访问 https://www.itying.com/category-93-b0.html
没有重复的
回复 2***@qq.com: 加一下其它的请求头也都不会携带吗?


