8***@qq.com
8***@qq.com
  • 发布:2019-07-24 15:30
  • 更新:2019-07-28 00:25
  • 阅读:5921

【报Bug】uni.request请求的header中放'Authorization': 'Basic xxxx'无效

分类:uni-app

详细问题描述

[内容]
H5端Post请求 header中放Basic xxxx 类型的Authorization无效,放Bearer xxxx类型的Authorization则可以;

重现步骤

uni.request({
url: this.url,
header: {
'Authorization': 'Basic dnVlOnZ1ZQ==',
//'content-type': 'application/x-www-form-urlencoded',
},
method: 'POST',
data: {
'username': this.inputClearValue,
'password': this.passValue,
'grant_type': 'password'
},
success: data => {
if (data.statusCode == 200) {

                },  
                fail: (data, code) => {  
                    console.log('fail' + JSON.stringify(data));  
                }  
            });  

[步骤]

[结果]
401 Unauthorized

2019-07-24 15:30 负责人:无 分享
已邀请:
2***@qq.com

2***@qq.com

这是后台的原因,查一下后台

  • 8***@qq.com (作者)

    嗯嗯 已经解决了 后台原因

    2019-07-29 15:06

  • 回复 8***@qq.com: 是什么导致的

    2022-12-20 16:49

该问题目前已经被锁定, 无法添加新回复