Commit 8b680255 by 李嘉林

道可问题

parent d9acdf7d
......@@ -45,6 +45,8 @@ function forUrlAddKey2(url, params) {
return urlHost
}
}
const app = getApp();
const { log } = app;
export default {
data() {
return {
......@@ -57,6 +59,7 @@ export default {
},
async onLoad(options) {
console.log(options,'--------------------options')
log.info("--------------------options",options)
this.link='';
/**
* scene=sso 第三方需要登录的页面
......@@ -141,9 +144,10 @@ export default {
} else {
url = res.webViewUrl;
}
console.log(forUrlAddKey2(url, ["token"]),777777777)
// forUrlAddKey2(url, ["token"])
console.log(url,'++++++++++++++++++',decodeURIComponent(url).replace(/\/\?(.+?)#\//, '/?token=${token}&scene=sso&toAppid=qOAhsauSaagQlxYdGbJL#/'),777777777)
if(url.indexOf('setToken={token}') == -1) {
url = forUrlAddKey2(url, ["token"]);
url = decodeURIComponent(url).replace(/\/\?(.+?)#\//, '/?token=${token}&scene=sso&toAppid=qOAhsauSaagQlxYdGbJL#/');
}
//分享页面去掉登录态
if (url.indexOf("sessionid") > -1) {
......@@ -203,6 +207,15 @@ export default {
this.setLink(res.data.data);
} else {
wx.showToast({ title: res.data.msg, icon: "none" });
if(res.data.msg == "登录人信息错误") {
// 跳转登录页
let backUrl = link.split("?")[0];
let ossLink = link.split("?")[1] +'?'+ link.split("?")[2];
let url = `/pages/login/main?scene=sso&isEncode=1&back=${backUrl}&ossLink=${encodeURIComponent(ossLink)}`;
wx.navigateTo({
url
});
}
}
});
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment