debug
This commit is contained in:
@@ -80,16 +80,16 @@ function handleRedirect() {
|
||||
|
||||
if (isMobile()) {
|
||||
// 移动端逻辑
|
||||
if (strCurrentPath.startsWith('/pc/')) {
|
||||
if (strCurrentPath.startsWith(strPcPath)) {
|
||||
// 如果路径包含 "/pc/",去除 "/pc/"
|
||||
const newPath = strCurrentPath.replace('/pc/', '/'); // 去除 "/pc/"
|
||||
const newPath = strCurrentPath.replace(strPcPath, '/'); // 去除 "/pc/"
|
||||
window.location.href = `${strCurrentHost}${newPath}`;
|
||||
}
|
||||
} else {
|
||||
// PC 端逻辑
|
||||
if (!strCurrentPath.startsWith('/pc/')) {
|
||||
if (!strCurrentPath.startsWith(strPcPath)) {
|
||||
// 如果路径不包含 "/pc/",添加 "/pc/"
|
||||
window.location.href = `${strCurrentHost}/pc${strCurrentPath}`;
|
||||
window.location.href = `${strCurrentHost}${strPcPath}${strCurrentPath}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,16 +81,16 @@ function handleRedirect() {
|
||||
|
||||
if (isMobile()) {
|
||||
// 移动端逻辑
|
||||
if (strCurrentPath.startsWith('/pc/')) {
|
||||
if (strCurrentPath.startsWith(strPcPath)) {
|
||||
// 如果路径包含 "/pc/",去除 "/pc/"
|
||||
const newPath = strCurrentPath.replace('/pc/', '/'); // 去除 "/pc/"
|
||||
const newPath = strCurrentPath.replace(strPcPath, '/'); // 去除 "/pc/"
|
||||
window.location.href = `${strCurrentHost}${newPath}`;
|
||||
}
|
||||
} else {
|
||||
// PC 端逻辑
|
||||
if (!strCurrentPath.startsWith('/pc/')) {
|
||||
if (!strCurrentPath.startsWith(strPcPath)) {
|
||||
// 如果路径不包含 "/pc/",添加 "/pc/"
|
||||
window.location.href = `${strCurrentHost}/pc${strCurrentPath}`;
|
||||
window.location.href = `${strCurrentHost}${strPcPath}${strCurrentPath}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user