Commit 0c9baf4f by 李嘉林

扫码落地页

parent aa72c08c
...@@ -66,77 +66,68 @@ export default { ...@@ -66,77 +66,68 @@ export default {
* scene=sso 第三方需要登录的页面 * scene=sso 第三方需要登录的页面
* login=1 jwt需要登录(临时方案) * login=1 jwt需要登录(临时方案)
*/ */
let link = "";
if (options.scene) { if (options.scene) {
//扫码 //扫码
let data = await this.getParams(options.scene); let data = await this.getParams(options.scene);
if (data.sso) { if (data.sso) {
let link = data.link; link = data.link;
if(getUrlKey(decodeURIComponent(link), "getMixId") == '1') {//第三方跳转加mixid }
link = forUrlAddKey(decodeURIComponent(link),{mixid: this.$store.state.mixid}) } else if (options.link) {
} link = options.link;
if (!wx.getStorageSync("sessionid")) { }
if(getUrlKey(decodeURIComponent(link), "getMixId") == '1') {//第三方跳转加mixid
link = forUrlAddKey(decodeURIComponent(link),{mixid: this.$store.state.mixid})
}
if(getUrlKey(decodeURIComponent(link), "scene") == 'dynamicForm') {
link = decodeURIComponent(link)
}
console.log(link,'--------------------------57')
if (getUrlKey(decodeURIComponent(link), "scene") == "sso") {
if (!wx.getStorageSync("sessionid")) {
// appraisalTwo:道可二级详情页面,之前进入道可项目所有页面都需登录,现在进入二级可不登录
if (!link.includes("appraisalTwo")) {
wx.redirectTo({ wx.redirectTo({
url: `../login/main?scene=sso&isEncode=1&back=${link}`, url: `../login/main?scene=sso&isEncode=1&back=${link}`,
}); });
} else { } else {
this.getSsoBcakUrl(decodeURIComponent(link).replace(/\/\?(.+?)#\//, '/?token=${token}&scene=sso&toAppid=qOAhsauSaagQlxYdGbJL#/'));
}
}
} else if (options.link) {
let link = options.link;
if(getUrlKey(decodeURIComponent(link), "getMixId") == '1') {//第三方跳转加mixid
link = forUrlAddKey(decodeURIComponent(link),{mixid: this.$store.state.mixid})
}
if(getUrlKey(decodeURIComponent(link), "scene") == 'dynamicForm') {
link = decodeURIComponent(link)
}
console.log(link,'--------------------------57')
if (getUrlKey(decodeURIComponent(link), "scene") == "sso") {
if (!wx.getStorageSync("sessionid")) {
// appraisalTwo:道可二级详情页面,之前进入道可项目所有页面都需登录,现在进入二级可不登录
if (!link.includes("appraisalTwo")) {
wx.redirectTo({
url: `../login/main?scene=sso&isEncode=1&back=${link}`,
});
} else {
this.setLink(decodeURIComponent(link));
}
} else {
this.getSsoBcakUrl(decodeURIComponent(link).replace(/\/\?(.+?)#\//, '/?token=${token}&scene=sso&toAppid=qOAhsauSaagQlxYdGbJL#/'));
}
} else if (getUrlKey(decodeURIComponent(link), "login") != "1") {
//判断是否需要带token
if(decodeURIComponent(link).indexOf('setToken={token}') > -1) {
if (wx.getStorageSync("sessionid")) {
this.getSsoBcakUrl(decodeURIComponent(link).replace(/\/\?(.+?)#\//, '/?token=${token}&scene=sso&toAppid=qOAhsauSaagQlxYdGbJL#/'))
} else {
let url = `/pages/login/main?scene=sso&isEncode=1&back=${link}`;
wx.navigateTo({
url
});
}
}else {
this.setLink(decodeURIComponent(link)); this.setLink(decodeURIComponent(link));
} }
} else { } else {
this.getSsoBcakUrl(decodeURIComponent(link).replace(/\/\?(.+?)#\//, '/?token=${token}&scene=sso&toAppid=qOAhsauSaagQlxYdGbJL#/'));
}
} else if (getUrlKey(decodeURIComponent(link), "login") != "1") {
//判断是否需要带token
if(decodeURIComponent(link).indexOf('setToken={token}') > -1) {
if (wx.getStorageSync("sessionid")) { if (wx.getStorageSync("sessionid")) {
this.setLink( this.getSsoBcakUrl(decodeURIComponent(link).replace(/\/\?(.+?)#\//, '/?token=${token}&scene=sso&toAppid=qOAhsauSaagQlxYdGbJL#/'))
forUrlAddKey(decodeURIComponent(link), {
token: wx.getStorageSync("sessionid"),
jwt: 1,
})
);
} else { } else {
let url = ""; let url = `/pages/login/main?scene=sso&isEncode=1&back=${link}`;
if(link.includes('formDesignDetail')){
url = `/pages/login/main?scene=sso&back=${encodeURIComponent(link)}`
} else {
url = `/pages/login/main?scene=sso&back=${link}`
}
wx.navigateTo({ wx.navigateTo({
url, url
}); });
} }
}else {
this.setLink(decodeURIComponent(link));
}
} else {
if (wx.getStorageSync("sessionid")) {
this.setLink(
forUrlAddKey(decodeURIComponent(link), {
token: wx.getStorageSync("sessionid"),
jwt: 1,
})
);
} else {
let url = "";
if(link.includes('formDesignDetail')){
url = `/pages/login/main?scene=sso&back=${encodeURIComponent(link)}`
} else {
url = `/pages/login/main?scene=sso&back=${link}`
}
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