IOS系统使用微信分享接口时候出现fail link must be in js secure domain list报错,在安卓实机上和微信开发工具上没有报错,路径上并没有中文字符,而且我还将路径后面的字符进行了转码也不行,不转码的时候也是不行的,安全域名为zhaodi.net.cn vue项目,微信相关代码如下
getWX_token() {
this .$ajax({
method: "post" ,
url: "notice/get_token/" ,
data: {
url: encodeURIComponent(location.href.split( "#" )[0])
}
})
.then(response => {
console.log(response);
this .wx_data = response.data;
this .wxApi();
})
. catch (error => {
Toast({
message: "服务器出错,请尝试刷新"
});
console.log(error + "测试错误" );
});
},
wxApi() {
let data = this .wx_data;
let URIstring = this .$route.path;
URIstring = URIstring.slice(12);
console.log(URIstring);
let option = {
title: this .news.title,
link: "http://zhaodi.net.cn:443/prevueinfo/" + encodeURIComponent(URIstring),
imgUrl: "http://118.31.60.22/static/images/landimages/" + this .news.img,
desc: this .news.desc
};
console.log(option.link);
setTimeout(() => {
wxapi.wxRegister(data, option);
}, 400);
}
|
const wxApi = {
wxRegister(data, option) {
wx.config({
debug: true ,
appId: data.app_id,
timestamp: data.timestamp,
nonceStr: data.noncestr,
signature: data.signature,
jsApiList: [
'checkJsApi' ,
'updateTimelineShareData' ,
'updateAppMessageShareData' ,
'onMenuShareQQ' ,
'onMenuShareWeibo'
]
})
wx.ready( function () {
wx.updateTimelineShareData({
title: option.title,
link: option.link,
imgUrl: option.imgUrl,
desc: option.desc,
success() {
alert(option.title)
option.success()
},
cancel() {
option.error()
}
});
wx.updateAppMessageShareData({
title: option.title,
desc: option.desc,
link: option.link,
imgUrl: option.imgUrl,
success() {
alert(option.title)
option.success()
},
cancel() {
option.error()
}
})
})
}
}
|
钥匙动态的链接怎么玩 ?
如:
http://www.baidu.com/web/index/detail?id=1
一直提示 fail link must be in js secure domain list 这时候要怎么配置
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及appid,操作时间
zhaodi.net.cn:443这个应该用zhaodi.net.cn,不带端口号就可以校验通过