Commit 8b680255 by 李嘉林

道可问题

parent d9acdf7d
...@@ -45,6 +45,8 @@ function forUrlAddKey2(url, params) { ...@@ -45,6 +45,8 @@ function forUrlAddKey2(url, params) {
return urlHost return urlHost
} }
} }
const app = getApp();
const { log } = app;
export default { export default {
data() { data() {
return { return {
...@@ -57,6 +59,7 @@ export default { ...@@ -57,6 +59,7 @@ export default {
}, },
async onLoad(options) { async onLoad(options) {
console.log(options,'--------------------options') console.log(options,'--------------------options')
log.info("--------------------options",options)
this.link=''; this.link='';
/** /**
* scene=sso 第三方需要登录的页面 * scene=sso 第三方需要登录的页面
...@@ -141,9 +144,10 @@ export default { ...@@ -141,9 +144,10 @@ export default {
} else { } else {
url = res.webViewUrl; 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) { 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) { if (url.indexOf("sessionid") > -1) {
...@@ -203,6 +207,15 @@ export default { ...@@ -203,6 +207,15 @@ export default {
this.setLink(res.data.data); this.setLink(res.data.data);
} else { } else {
wx.showToast({ title: res.data.msg, icon: "none" }); 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