任一存 1 年之前
父節點
當前提交
e9807645ad
共有 2 個文件被更改,包括 11 次插入1 次删除
  1. 二進制
      src/assets/images/login-form-bg.png
  2. 11 1
      src/components/IframeWrap.vue

二進制
src/assets/images/login-form-bg.png


+ 11 - 1
src/components/IframeWrap.vue

@@ -24,7 +24,7 @@ const router = useRouter()
 const route = useRoute()
 const $isTablet = inject('$isTablet')
 const $isMobile = inject('$isMobile')
-
+const $isSafari = inject('$isSafari')
 const emit = defineEmits(['back'])
 
 const iframeRef = ref(null)
@@ -36,6 +36,16 @@ onMounted(() => {
   iframeRef.value.contentWindow.goToLogin = () => {
     location.href = `https://open.weixin.qq.com/connect/qrconnect?appid=wx3d4f2e0cfc3b8e54&redirect_uri=https%3A%2F%2Fsit-wuxicishan.4dage.com%2F%23%2Flogin-temp&response_type=code&scope=snsapi_login&state=${encodeURIComponent(route.name)}#wechat_redirect`
   }
+  iframeRef.value.openWindow = function(url) {
+    console.log(`iframe: openWindow(${url})`)
+    if ($isSafari) {
+      // 不知道行不行,先试试
+      let windowObjectReference = window.open()
+      windowObjectReference.location.href = url
+    } else {
+      window.open(url)
+    }
+  }
 })
 
 const _showClose = computed(() => props.showClose && !$isMobile && !$isTablet)