소스 검색

修改没有window.vuplex问题

Renxy 1 년 전
부모
커밋
f7ee03be42
3개의 변경된 파일3개의 추가작업 그리고 11개의 파일을 삭제
  1. 0 3
      src/app.ts
  2. 0 3
      src/global.js
  3. 3 5
      src/utils/utils.js

+ 0 - 3
src/app.ts

@@ -102,6 +102,3 @@ const tokenExpiredHandle = (code: number) => {
     return false;
   }
 };
-if (window.vuplex) {
-  alert('---------app----------');
-}

+ 0 - 3
src/global.js

@@ -6,6 +6,3 @@ if (token) {
   storeToken(token);
   console.log(token);
 }
-if (window.vuplex) {
-  alert('---------global---------');
-}

+ 3 - 5
src/utils/utils.js

@@ -105,10 +105,8 @@ export function getUser(params) {
 export const UnityAction = {
   event: {},
   on(type, callback) {
-    if (window.vuplex) {
-      alert('----------on----------');
-      addUnityListener();
-    }
+    //修改添加unity时间监听时没有vuplex问题
+    addUnityListener();
     if (!UnityAction.event[type]) {
       UnityAction.event[type] = [];
     }
@@ -151,7 +149,7 @@ export const UnityAction = {
   },
 };
 
-export function addUnityListener() {
+function addUnityListener() {
   if (window.vuplex) {
     window.vuplex.addEventListener('message', (e) => {
       console.log(