e***@163.com
e***@163.com
  • 发布:2020-06-03 10:43
  • 更新:2020-06-03 10:51
  • 阅读:1069

mui.ajax中 "Bearer "+token 看我这样写对吗?

分类:HBuilderX
                            var _token=...............................  
            mui.ajax({  
                url: 'http://192.168........',  
                data: {},  
                async: true,  
                dataType: 'json',  
                crossDomain: true, //强制使用5+跨域  
                type: 'get',  
                timeout: 60000,  
                headers: {  
                    Authorization: 'Bearer' + _token    //看这里,是直接这样写吗?  
                },  
                success: function(msg) {  
                    console.log('ss:' + msg);  
                },  
                error: function(xhr, type, errorThrown) {  
                    console.log(errorThrown);  
                }  
            });
2020-06-03 10:43 负责人:无 分享
已邀请:
e***@163.com

e***@163.com (作者) - zzyhost

以解决:'Bearer' + _token,少个空格,'Bearer ' + _token

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