|
@@ -8,12 +8,18 @@ import { handleThemeStyle } from "@/utils/theme";
|
|
|
import { onMounted, nextTick } from "vue";
|
|
|
import { isMobile } from "@/utils/utils";
|
|
|
onMounted(() => {
|
|
|
+ const currentHost = window.location.hostname;
|
|
|
+
|
|
|
if (isMobile()) {
|
|
|
- console.log("当前设备是移动设备");
|
|
|
- // window.location.href = "https://wap.wi-tour.com";
|
|
|
+ // 如果当前不是在 wap 域名,就跳转
|
|
|
+ // if (currentHost !== "wap.wi-tour.com") {
|
|
|
+ // window.location.href = "https://wap.wi-tour.com";
|
|
|
+ // }
|
|
|
} else {
|
|
|
- console.log("当前设备是电脑");
|
|
|
- window.location.href = "https://www.wi-tour.com";
|
|
|
+ // 如果当前不是在 www 域名,就跳转
|
|
|
+ if (currentHost !== "www.wi-tour.com") {
|
|
|
+ window.location.href = "https://www.wi-tour.com";
|
|
|
+ }
|
|
|
}
|
|
|
nextTick(() => {
|
|
|
// 初始化主题样式
|