diff --git a/src/mixins/article/index.js b/src/mixins/article/index.js index 09a1ad5..573d474 100644 --- a/src/mixins/article/index.js +++ b/src/mixins/article/index.js @@ -41,7 +41,13 @@ export default { } // 是否新窗口打开 if (to.isOpen) { - window.open(href) + var userAgent = navigator.userAgent; + var isSafari = /Safari/.test(userAgent) && !/Chrome/.test(userAgent); + if(isSafari) { + window.location.href = href + }else { + window.open(href) + } } else { location.href = href } @@ -71,7 +77,13 @@ export default { } // 是否新窗口打开 if (item.isOpen) { - window.open(href) + var userAgent = navigator.userAgent; + var isSafari = /Safari/.test(userAgent) && !/Chrome/.test(userAgent); + if(isSafari) { + window.location.href = href + }else { + window.open(href) + } } else { location.href = href } diff --git a/src/mixins/page/index.js b/src/mixins/page/index.js index fcacf9f..2770c50 100644 --- a/src/mixins/page/index.js +++ b/src/mixins/page/index.js @@ -62,9 +62,16 @@ export default { // 跳转地址 toHref(isOpen, href) { if (isOpen) { - window.open(href) + var userAgent = navigator.userAgent; + var isSafari = /Safari/.test(userAgent) && !/Chrome/.test(userAgent); + if(isSafari) { + window.location.href = href + }else { + window.open(href) + } } else { - location.href = href + + window.location.href = href } }, // 跳转文章页面 diff --git a/src/pages/column/index.vue b/src/pages/column/index.vue index d40c324..29847de 100644 --- a/src/pages/column/index.vue +++ b/src/pages/column/index.vue @@ -413,7 +413,13 @@ export default { } // 是否新窗口打开 if (to.isOpen) { - window.open(href); + var userAgent = navigator.userAgent; + var isSafari = /Safari/.test(userAgent) && !/Chrome/.test(userAgent); + if(isSafari) { + window.location.href = href + }else { + window.open(href) + } } else { location.href = href; } diff --git a/src/pages/home/index.vue b/src/pages/home/index.vue index 7d795b7..1ea460e 100644 --- a/src/pages/home/index.vue +++ b/src/pages/home/index.vue @@ -64,7 +64,7 @@
{{ item.title }}

{{ item.des }}

- +
diff --git a/src/pages/news/index.vue b/src/pages/news/index.vue index 2a08962..2b37e0c 100644 --- a/src/pages/news/index.vue +++ b/src/pages/news/index.vue @@ -260,7 +260,14 @@ export default { } // 是否新窗口打开 if (data.isOpen) { - window.open(href) + // window.open(href) + var userAgent = navigator.userAgent; + var isSafari = /Safari/.test(userAgent) && !/Chrome/.test(userAgent); + if(isSafari) { + window.location.href = href + }else { + window.open(href) + } } else { location.href = href }