Commit 2cb5e97e by 程默

fix

parent e4610c73
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
}; };
}, },
async onLoad(options) { async onLoad(options) {
console.log(options, '第三方页面'); console.log(options, "第三方页面");
/** /**
* scene=sso 第三方需要登录的页面 * scene=sso 第三方需要登录的页面
* login=1 jwt需要登录(临时方案) * login=1 jwt需要登录(临时方案)
...@@ -56,13 +56,15 @@ export default { ...@@ -56,13 +56,15 @@ export default {
this.getSsoBcakUrl(decodeURIComponent(options.link)); this.getSsoBcakUrl(decodeURIComponent(options.link));
} }
} else if (getUrlKey(decodeURIComponent(options.link), "login") != "1") { } else if (getUrlKey(decodeURIComponent(options.link), "login") != "1") {
this.link = decodeURIComponent(options.link); this.setLink(decodeURIComponent(options.link));
} else { } else {
if (wx.getStorageSync("sessionid")) { if (wx.getStorageSync("sessionid")) {
this.link = forUrlAddKey(decodeURIComponent(options.link), { this.setLink(
token: wx.getStorageSync("sessionid"), forUrlAddKey(decodeURIComponent(options.link), {
jwt: 1, token: wx.getStorageSync("sessionid"),
}); jwt: 1,
})
);
} else { } else {
let url = `/pages/login/main?scene=sso&back=${options.link}`; let url = `/pages/login/main?scene=sso&back=${options.link}`;
wx.navigateTo({ wx.navigateTo({
...@@ -117,6 +119,9 @@ export default { ...@@ -117,6 +119,9 @@ export default {
}; };
}, },
methods: { methods: {
setLink(data) {
this.link = data;
},
getSsoBcakUrl(link) { getSsoBcakUrl(link) {
let op = { let op = {
callbackUrl: link, callbackUrl: link,
...@@ -128,9 +133,8 @@ export default { ...@@ -128,9 +133,8 @@ export default {
wxAvatarUrl: this.$store.state.userInfo.avatarUrl, wxAvatarUrl: this.$store.state.userInfo.avatarUrl,
}; };
login.getSsoBcakUrl(op).then((res) => { login.getSsoBcakUrl(op).then((res) => {
console.log(res, this.link, 555444);
if (res.data.code == "200") { if (res.data.code == "200") {
this.link = 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" });
} }
......
...@@ -158,9 +158,11 @@ export default { ...@@ -158,9 +158,11 @@ export default {
} }
// sso场景(跳转第三方url) // sso场景(跳转第三方url)
if (_this.scene == "sso") { if (_this.scene == "sso") {
wx.redirectTo({ setTimeout(() => {
url: `../wxArticle/main?from=sso&link=${_this.backUrl}`, wx.redirectTo({
}); url: `../wxArticle/main?from=sso&link=${_this.backUrl}`,
});
}, 500);
return; return;
} }
......
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