新增跳转时打开新窗口功能
This commit is contained in:
@@ -33,3 +33,86 @@ window.CURRENT_ENV = (function () {
|
|||||||
|
|
||||||
// 获取当前环境配置
|
// 获取当前环境配置
|
||||||
window.CURRENT_CONFIG = window.ENV[window.CURRENT_ENV];
|
window.CURRENT_CONFIG = window.ENV[window.CURRENT_ENV];
|
||||||
|
|
||||||
|
window.NavigationUtil = (function (window, document) {
|
||||||
|
const blockedProtocols = /^(?:javascript|data|vbscript|mailto|tel):/i;
|
||||||
|
|
||||||
|
function shouldOpenInNewTab(anchor) {
|
||||||
|
const href = (anchor.getAttribute('href') || '').trim();
|
||||||
|
|
||||||
|
return href && href !== '#' && !href.startsWith('#') &&
|
||||||
|
!anchor.hasAttribute('download') && !blockedProtocols.test(href);
|
||||||
|
}
|
||||||
|
|
||||||
|
function prepareAnchor(anchor) {
|
||||||
|
if (!anchor || anchor.tagName !== 'A' || !shouldOpenInNewTab(anchor)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (anchor.target !== '_blank') {
|
||||||
|
anchor.target = '_blank';
|
||||||
|
}
|
||||||
|
|
||||||
|
const relTokens = (anchor.getAttribute('rel') || '').split(/\s+/).filter(Boolean);
|
||||||
|
|
||||||
|
if (!relTokens.includes('noopener')) {
|
||||||
|
anchor.setAttribute('rel', [...relTokens, 'noopener'].join(' '));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function prepareAnchors(root) {
|
||||||
|
if (root.nodeType === 1 && root.matches('a[href]')) {
|
||||||
|
prepareAnchor(root);
|
||||||
|
}
|
||||||
|
|
||||||
|
root.querySelectorAll('a[href]').forEach(prepareAnchor);
|
||||||
|
}
|
||||||
|
|
||||||
|
function installLinkTargeting() {
|
||||||
|
prepareAnchors(document);
|
||||||
|
|
||||||
|
new MutationObserver((mutations) => {
|
||||||
|
mutations.forEach((mutation) => {
|
||||||
|
if (mutation.type === 'attributes') {
|
||||||
|
prepareAnchor(mutation.target);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mutation.addedNodes.forEach((node) => {
|
||||||
|
if (node.nodeType === 1) {
|
||||||
|
prepareAnchors(node);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}).observe(document.documentElement, {
|
||||||
|
subtree: true,
|
||||||
|
childList: true,
|
||||||
|
attributes: true,
|
||||||
|
attributeFilter: ['href', 'target', 'download']
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.readyState === 'loading') {
|
||||||
|
document.addEventListener('DOMContentLoaded', installLinkTargeting, { once: true });
|
||||||
|
} else {
|
||||||
|
installLinkTargeting();
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
open(url) {
|
||||||
|
const destination = String(url || '').trim();
|
||||||
|
|
||||||
|
if (!destination) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
const openedWindow = window.open(destination, '_blank', 'noopener');
|
||||||
|
|
||||||
|
if (openedWindow) {
|
||||||
|
openedWindow.opener = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return openedWindow;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
})(window, document);
|
||||||
|
|||||||
+1
-1
@@ -373,7 +373,7 @@
|
|||||||
"资料上传成功,请等待审核通过",
|
"资料上传成功,请等待审核通过",
|
||||||
{ icon: 1, time: 1800 },
|
{ icon: 1, time: 1800 },
|
||||||
function () {
|
function () {
|
||||||
window.location.href = "usercenter.html";
|
NavigationUtil.open("usercenter.html");
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+4
-4
@@ -3,12 +3,12 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<script src="../config.js"></script>
|
||||||
<title id="page-title">神彩算 - 免费文章收藏</title>
|
<title id="page-title">神彩算 - 免费文章收藏</title>
|
||||||
<script>
|
<script>
|
||||||
window.location.replace("mianfeishoucang.html?tab=free");
|
NavigationUtil.open("mianfeishoucang.html?tab=free");
|
||||||
</script>
|
</script>
|
||||||
<script src="../public/css/layui/layui.js"></script>
|
<script src="../public/css/layui/layui.js"></script>
|
||||||
<script src="../config.js"></script>
|
|
||||||
<script src="../utils/ApiClient.js"></script>
|
<script src="../utils/ApiClient.js"></script>
|
||||||
<script src="../utils/DateUtil.js"></script>
|
<script src="../utils/DateUtil.js"></script>
|
||||||
<script src="../utils/CommonUtil.js"></script>
|
<script src="../utils/CommonUtil.js"></script>
|
||||||
@@ -137,7 +137,7 @@
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
window.location.href = "login.html";
|
NavigationUtil.open("login.html");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -157,7 +157,7 @@
|
|||||||
function loadCollections() {
|
function loadCollections() {
|
||||||
const token = localStorage.getItem("token");
|
const token = localStorage.getItem("token");
|
||||||
if (!token) {
|
if (!token) {
|
||||||
window.location.href = "login.html";
|
NavigationUtil.open("login.html");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -246,7 +246,7 @@
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
window.location.href = "login.html";
|
NavigationUtil.open("login.html");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -254,7 +254,7 @@
|
|||||||
"您还不是实习或正式专家,暂不能发布文章。",
|
"您还不是实习或正式专家,暂不能发布文章。",
|
||||||
{ title: "暂无权限" },
|
{ title: "暂无权限" },
|
||||||
function () {
|
function () {
|
||||||
window.location.href = "apply.html";
|
NavigationUtil.open("apply.html");
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
@@ -284,7 +284,7 @@
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
window.location.href = targetHref;
|
NavigationUtil.open(targetHref);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -525,7 +525,7 @@
|
|||||||
"发布成功,请等待审核",
|
"发布成功,请等待审核",
|
||||||
{ icon: 1, time: 1600 },
|
{ icon: 1, time: 1600 },
|
||||||
function () {
|
function () {
|
||||||
window.location.href = "index.html";
|
NavigationUtil.open("index.html");
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+1
-1
@@ -217,7 +217,7 @@
|
|||||||
|
|
||||||
function logout() {
|
function logout() {
|
||||||
localStorage.removeItem("token");
|
localStorage.removeItem("token");
|
||||||
window.location.href = "login.html";
|
NavigationUtil.open("login.html");
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderLoginState() {
|
function renderLoginState() {
|
||||||
|
|||||||
+3
-3
@@ -210,7 +210,7 @@
|
|||||||
{ btn: ["去登录", "取消"] },
|
{ btn: ["去登录", "取消"] },
|
||||||
function (index) {
|
function (index) {
|
||||||
layui.layer.close(index);
|
layui.layer.close(index);
|
||||||
window.location.href = "login.html";
|
NavigationUtil.open("login.html");
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -566,11 +566,11 @@
|
|||||||
ApiClient.post(ApiClient.API.authLogout, {})
|
ApiClient.post(ApiClient.API.authLogout, {})
|
||||||
.then(function () {
|
.then(function () {
|
||||||
localStorage.removeItem("token");
|
localStorage.removeItem("token");
|
||||||
window.location.href = "login.html";
|
NavigationUtil.open("login.html");
|
||||||
})
|
})
|
||||||
.catch(function () {
|
.catch(function () {
|
||||||
localStorage.removeItem("token");
|
localStorage.removeItem("token");
|
||||||
window.location.href = "login.html";
|
NavigationUtil.open("login.html");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -316,7 +316,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function redirectAfterLogin() {
|
function redirectAfterLogin() {
|
||||||
window.location.href = getLoginRedirectUrl();
|
NavigationUtil.open(getLoginRedirectUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
function bindReferralThenRedirect() {
|
function bindReferralThenRedirect() {
|
||||||
|
|||||||
+3
-3
@@ -497,7 +497,7 @@
|
|||||||
{ icon: 3, title: "提示" },
|
{ icon: 3, title: "提示" },
|
||||||
function (index) {
|
function (index) {
|
||||||
layui.layer.close(index);
|
layui.layer.close(index);
|
||||||
window.location.href = "login.html";
|
NavigationUtil.open("login.html");
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
@@ -533,7 +533,7 @@
|
|||||||
{ icon: 3, title: "提示" },
|
{ icon: 3, title: "提示" },
|
||||||
function (index) {
|
function (index) {
|
||||||
layui.layer.close(index);
|
layui.layer.close(index);
|
||||||
window.location.href = "login.html";
|
NavigationUtil.open("login.html");
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
@@ -671,7 +671,7 @@
|
|||||||
{ icon: 3, title: "提示" },
|
{ icon: 3, title: "提示" },
|
||||||
function (index) {
|
function (index) {
|
||||||
layui.layer.close(index);
|
layui.layer.close(index);
|
||||||
window.location.href = "login.html";
|
NavigationUtil.open("login.html");
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -223,7 +223,7 @@
|
|||||||
|
|
||||||
function checkLogin() {
|
function checkLogin() {
|
||||||
if (!CommonUtil.getAuthToken()) {
|
if (!CommonUtil.getAuthToken()) {
|
||||||
window.location.href = "login.html";
|
NavigationUtil.open("login.html");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -41,6 +41,7 @@
|
|||||||
color: #111827;
|
color: #111827;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<script src="../config.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="box">
|
<div class="box">
|
||||||
@@ -59,7 +60,7 @@
|
|||||||
if (!inApp && location.search.indexOf(prefix) === 0) {
|
if (!inApp && location.search.indexOf(prefix) === 0) {
|
||||||
const target = location.search.slice(prefix.length);
|
const target = location.search.slice(prefix.length);
|
||||||
if (target && target.charAt(0) === "/" && target.indexOf("//") !== 0) {
|
if (target && target.charAt(0) === "/" && target.indexOf("//") !== 0) {
|
||||||
location.replace(target);
|
NavigationUtil.open(target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
+4
-3
@@ -712,14 +712,15 @@
|
|||||||
|
|
||||||
function redirectAfterRegister(hasToken) {
|
function redirectAfterRegister(hasToken) {
|
||||||
if (hasToken) {
|
if (hasToken) {
|
||||||
window.location.href =
|
NavigationUtil.open(
|
||||||
typeof CommonUtil !== "undefined"
|
typeof CommonUtil !== "undefined"
|
||||||
? CommonUtil.siteHref("/index.html")
|
? CommonUtil.siteHref("/index.html")
|
||||||
: "index.html";
|
: "index.html",
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
window.location.href = "login.html";
|
NavigationUtil.open("login.html");
|
||||||
}
|
}
|
||||||
|
|
||||||
function finishRegisterSuccess(res) {
|
function finishRegisterSuccess(res) {
|
||||||
|
|||||||
+1
-1
@@ -529,7 +529,7 @@
|
|||||||
"密码重置成功,即将前往登录",
|
"密码重置成功,即将前往登录",
|
||||||
{ icon: 1, time: 1200 },
|
{ icon: 1, time: 1200 },
|
||||||
function () {
|
function () {
|
||||||
window.location.href = "login.html";
|
NavigationUtil.open("login.html");
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -176,7 +176,7 @@
|
|||||||
function redirectHome() {
|
function redirectHome() {
|
||||||
setStatus("登录成功,正在跳转...", false);
|
setStatus("登录成功,正在跳转...", false);
|
||||||
window.setTimeout(() => {
|
window.setTimeout(() => {
|
||||||
window.location.replace(homeUrl());
|
NavigationUtil.open(homeUrl());
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,7 +238,7 @@
|
|||||||
clearAccountBindMode();
|
clearAccountBindMode();
|
||||||
setStatus("微信绑定成功,正在返回个人中心...", false);
|
setStatus("微信绑定成功,正在返回个人中心...", false);
|
||||||
window.setTimeout(() => {
|
window.setTimeout(() => {
|
||||||
window.location.replace(returnUrl);
|
NavigationUtil.open(returnUrl);
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -312,7 +312,7 @@
|
|||||||
function checkLogin() {
|
function checkLogin() {
|
||||||
const token = CommonUtil.getAuthToken ? CommonUtil.getAuthToken() : localStorage.getItem("token");
|
const token = CommonUtil.getAuthToken ? CommonUtil.getAuthToken() : localStorage.getItem("token");
|
||||||
if (!token) {
|
if (!token) {
|
||||||
window.location.href = "login.html";
|
NavigationUtil.open("login.html");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$("#notLoggedInBox").addClass("tx-hidden");
|
$("#notLoggedInBox").addClass("tx-hidden");
|
||||||
|
|||||||
@@ -235,7 +235,7 @@
|
|||||||
function checkLogin() {
|
function checkLogin() {
|
||||||
const token = CommonUtil.getAuthToken ? CommonUtil.getAuthToken() : localStorage.getItem("token");
|
const token = CommonUtil.getAuthToken ? CommonUtil.getAuthToken() : localStorage.getItem("token");
|
||||||
if (!token) {
|
if (!token) {
|
||||||
window.location.href = "login.html";
|
NavigationUtil.open("login.html");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$("#notLoggedInBox").addClass("tl-hidden");
|
$("#notLoggedInBox").addClass("tl-hidden");
|
||||||
|
|||||||
+1
-1
@@ -355,7 +355,7 @@
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
window.location.href = "login.html";
|
NavigationUtil.open("login.html");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -256,6 +256,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
<script src="../config.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<main class="wrap" aria-labelledby="page-title">
|
<main class="wrap" aria-labelledby="page-title">
|
||||||
|
|||||||
@@ -112,26 +112,26 @@
|
|||||||
<button
|
<button
|
||||||
class="uc-btn uc-btn-expert"
|
class="uc-btn uc-btn-expert"
|
||||||
id="expertApplyBtn"
|
id="expertApplyBtn"
|
||||||
onclick="window.location.href = 'apply.html'"
|
onclick="NavigationUtil.open('apply.html')"
|
||||||
>
|
>
|
||||||
专家申请
|
专家申请
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="uc-btn uc-btn-publish"
|
class="uc-btn uc-btn-publish"
|
||||||
id="publishArticleBtn"
|
id="publishArticleBtn"
|
||||||
onclick="window.location.href = 'fabumianfeiwenzhang.html'"
|
onclick="NavigationUtil.open('fabumianfeiwenzhang.html')"
|
||||||
>
|
>
|
||||||
发布文章
|
发布文章
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="uc-btn uc-btn-collection"
|
class="uc-btn uc-btn-collection"
|
||||||
onclick="window.location.href = 'mianfeishoucang.html?tab=free'"
|
onclick="NavigationUtil.open('mianfeishoucang.html?tab=free')"
|
||||||
>
|
>
|
||||||
我的收藏
|
我的收藏
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
class="uc-btn uc-btn-tuiguang"
|
class="uc-btn uc-btn-tuiguang"
|
||||||
onclick="window.location.href = 'tuiguang.html'"
|
onclick="NavigationUtil.open('tuiguang.html')"
|
||||||
>
|
>
|
||||||
分享推广
|
分享推广
|
||||||
</button>
|
</button>
|
||||||
@@ -530,7 +530,7 @@
|
|||||||
if (state.isApplying) {
|
if (state.isApplying) {
|
||||||
$applyBtn.removeAttr("onclick");
|
$applyBtn.removeAttr("onclick");
|
||||||
} else {
|
} else {
|
||||||
$applyBtn.attr("onclick", "window.location.href = 'apply.html'");
|
$applyBtn.attr("onclick", "NavigationUtil.open('apply.html')");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -695,7 +695,7 @@
|
|||||||
{ btn: ["去登录", "取消"] },
|
{ btn: ["去登录", "取消"] },
|
||||||
function (index) {
|
function (index) {
|
||||||
layui.layer.close(index);
|
layui.layer.close(index);
|
||||||
window.location.href = "login.html";
|
NavigationUtil.open("login.html");
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -757,7 +757,7 @@
|
|||||||
});
|
});
|
||||||
localStorage.removeItem("token");
|
localStorage.removeItem("token");
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
window.location.href = "login.html";
|
NavigationUtil.open("login.html");
|
||||||
}, 1500);
|
}, 1500);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -812,11 +812,11 @@
|
|||||||
ApiClient.post(ApiClient.API.authLogout, null, { headers: CommonUtil.authHeaders() })
|
ApiClient.post(ApiClient.API.authLogout, null, { headers: CommonUtil.authHeaders() })
|
||||||
.then(function (res) {
|
.then(function (res) {
|
||||||
localStorage.removeItem("token");
|
localStorage.removeItem("token");
|
||||||
window.location.href = "login.html";
|
NavigationUtil.open("login.html");
|
||||||
})
|
})
|
||||||
.catch(function () {
|
.catch(function () {
|
||||||
localStorage.removeItem("token");
|
localStorage.removeItem("token");
|
||||||
window.location.href = "login.html";
|
NavigationUtil.open("login.html");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const $ = layui.$;
|
|||||||
title: "暂无权限",
|
title: "暂无权限",
|
||||||
},
|
},
|
||||||
function () {
|
function () {
|
||||||
window.location.href = "fabumianfeiwenzhang.html";
|
NavigationUtil.open("fabumianfeiwenzhang.html");
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
@@ -754,7 +754,7 @@ const $ = layui.$;
|
|||||||
throw new Error(res.msg || "发布失败");
|
throw new Error(res.msg || "发布失败");
|
||||||
}
|
}
|
||||||
layer.msg("发布成功", { icon: 1, time: 1200 }, function () {
|
layer.msg("发布成功", { icon: 1, time: 1200 }, function () {
|
||||||
window.location.href = "usercenter.html";
|
NavigationUtil.open("usercenter.html");
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(function (error) {
|
.catch(function (error) {
|
||||||
|
|||||||
+3
-3
@@ -173,7 +173,7 @@ const ApiClient = {
|
|||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
if (response.status === 401) {
|
if (response.status === 401) {
|
||||||
localStorage.removeItem('token');
|
localStorage.removeItem('token');
|
||||||
window.location.href = 'login.html';
|
NavigationUtil.open('login.html');
|
||||||
}
|
}
|
||||||
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
||||||
}
|
}
|
||||||
@@ -331,10 +331,10 @@ const ApiClient = {
|
|||||||
if (/\/(login|reg|repwd)\.html$/i.test(path)) return;
|
if (/\/(login|reg|repwd)\.html$/i.test(path)) return;
|
||||||
const returnUrl = window.location.pathname + window.location.search;
|
const returnUrl = window.location.pathname + window.location.search;
|
||||||
const loginPath = '/login.html?redirect=' + encodeURIComponent(returnUrl);
|
const loginPath = '/login.html?redirect=' + encodeURIComponent(returnUrl);
|
||||||
window.location.href =
|
NavigationUtil.open(
|
||||||
typeof CommonUtil !== 'undefined' && CommonUtil.siteHref
|
typeof CommonUtil !== 'undefined' && CommonUtil.siteHref
|
||||||
? CommonUtil.siteHref(loginPath)
|
? CommonUtil.siteHref(loginPath)
|
||||||
: ((window.CURRENT_ENV === 'development' ? '/html/login.html?redirect=' : '/login.html?redirect=') + encodeURIComponent(returnUrl));
|
: ((window.CURRENT_ENV === 'development' ? '/html/login.html?redirect=' : '/login.html?redirect=') + encodeURIComponent(returnUrl)));
|
||||||
},
|
},
|
||||||
|
|
||||||
buildUrl(url, params) {
|
buildUrl(url, params) {
|
||||||
|
|||||||
+3
-3
@@ -110,7 +110,7 @@ const CommonUtil = {
|
|||||||
{ btn: ['去登录', '取消'] },
|
{ btn: ['去登录', '取消'] },
|
||||||
function (index) {
|
function (index) {
|
||||||
layui.layer.close(index);
|
layui.layer.close(index);
|
||||||
window.location.href = 'login.html';
|
NavigationUtil.open('login.html');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
@@ -1178,7 +1178,7 @@ const CommonUtil = {
|
|||||||
}
|
}
|
||||||
const authUrl = this.extractWechatAuthUrl(res);
|
const authUrl = this.extractWechatAuthUrl(res);
|
||||||
if (!authUrl) throw new Error('后端未返回微信授权地址');
|
if (!authUrl) throw new Error('后端未返回微信授权地址');
|
||||||
window.location.href = authUrl;
|
NavigationUtil.open(authUrl);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
const message = error.message || '微信登录暂不可用,请稍后再试';
|
const message = error.message || '微信登录暂不可用,请稍后再试';
|
||||||
@@ -1325,7 +1325,7 @@ const CommonUtil = {
|
|||||||
}
|
}
|
||||||
const authUrl = this.extractWechatAuthUrl(res);
|
const authUrl = this.extractWechatAuthUrl(res);
|
||||||
if (!authUrl) throw new Error('后端未返回微信授权地址');
|
if (!authUrl) throw new Error('后端未返回微信授权地址');
|
||||||
window.location.href = authUrl;
|
NavigationUtil.open(authUrl);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
const message = error.message || '微信绑定暂不可用,请稍后再试';
|
const message = error.message || '微信绑定暂不可用,请稍后再试';
|
||||||
|
|||||||
Reference in New Issue
Block a user