wx.miniprogram.redirectto API报错 {errMsg: "invokeMiniProgramAPI:fail, the permission value is offline verifying"}, 之前一直没问题, 昨天突然报错
<!DOCTYPE html>
<html>
<head>
<title>授权</title>
<script type="text/javascript" src="https://res2.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script>
/**获取url参数方法*/
function getParameterByName(name, url) {
if(!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
//匹配所有符合条件的,并取最后一个
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)",'g');
var results = url.match(regex);
var tempResults= results!=null && results[results.length-1]!=undefined?results[results.length-1]:'';
var finalResults=regex.exec(tempResults);
if(!finalResults) return "";
if(!finalResults[2]) return '';
return decodeURIComponent(finalResults[2].replace(/\+/g, " "));
}
if (getParameterByName('code')) {/**重新跳回小程序的方法*/
wx.miniProgram.redirectTo({url: '/pages/out/out?code=' + getParameterByName('code')})
//wx.miniProgram.switchTab({url: '/pages/index/index/main?code=' + getParameterByName('code')})
}else{
/**公众号授权方法*/
var uri = window.location.href;
window.location.href = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxba45c92ec95c55bc&redirect_uri="+uri+"&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";
}
</script>
</head>
<body>
<!-- <span style="background: red">haha</span> -->
</body>
</html>
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)