[问题求助]
本地调试HWH5.Internet调用服务端API报403错误
获取access_token的API文档:https://open.welink.huaweicloud.com/docs/#/990hh0/ka0vzc/q76fsn
.vue文件中有如下代码
// 服务端API,获取access_token
const url_getToken =
'https://open.welink.huaweicloud.com/api/auth/v2/tickets';
// 请求头部
const _headers = {
'Content-Type': 'application/json'
};
// 入参
const _params = {
client_id: '20210105172918119229937',
client_secret: '6c0c63d8-423f-4837-94b4-1984a394aa34',
};
// 访问
HWH5.fetchInternet(url_getToken, {
method: 'post',
body: JSON.stringify(_params),
headers: _headers
})
.then(res => {
res.json().then(reply => {
console.log('服务端返回: ', reply);
this.textData = JSON.stringify(reply);
});
})
.catch(error => {
console.log('请求异常', error);
this.textData = JSON.stringify(error);
});
} // func end
关联的we码程序信息如下图
本地调试时报错403
但是在手机上预览测试是能正常调用的,本地调试是缺少什么鉴权吗?