var plugin = requirePlugin(“myPlugin”)
Page({
onLoad: function() {
// plugin.getData()
this.getQrCode();
},
getQrCode: function () {
var that = this;
var plugin = requirePlugin(“myPlugin”)
Page({
onLoad: function() {
// plugin.getData()
this.getQrCode();
},
//获取二维码并且跳转
getQrCode: function () {
var that = this;
wx.request({
url: ‘https://rz.weijing.gov.cn/api/getaccesstoken’,
data: {
client_id: ‘123’,
client_secret: ‘3333’
},
header: {
‘content-type’: ‘application/json’ // 默认值
},
success: function (res) {
console.log(“关闭不校验合法域名,可以正常请求”)
},
fail: function (e) {
wx.showModal({
title: ‘提示’,
content: JSON.stringify(e),
})
}
});
}
})
后台设置了合法域名,真机调试的时候关闭调试模式,一直提示,域名不在合法域名列表中,开发工具中关闭不校验合法域名试调是正常的。