From 95eab22ba9208ac03fa206acba4096e8d0198a73 Mon Sep 17 00:00:00 2001
From: Tevin <tingquanren@163.com>
Date: Thu, 19 Aug 2021 16:16:35 +0800
Subject: [PATCH] 调整App请求模式,增加状态码转换与登陆失效跳转

---
 common/Bridge.js |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/common/Bridge.js b/common/Bridge.js
index d5cdfc2..1c1c5e8 100644
--- a/common/Bridge.js
+++ b/common/Bridge.js
@@ -42,7 +42,7 @@
      */
     _checkLinking() {
         // 安卓注入
-        if (window.linking) {
+        if (window.aisim && window.aisim.linking) {
             return 'android';
         }
         // 没有注入
@@ -102,7 +102,7 @@
             delete this[name];
         };
         // 发送
-        window.linking(JSON.stringify({
+        window.aisim.linking(JSON.stringify({
             method,
             param,
             callback: 'bridge.' + name,
@@ -121,8 +121,6 @@
         if (trans && Object.prototype.toString.call(trans) === '[object Function]') {
             callback = trans;
             param = {};
-        } else {
-            callback = null;
         }
         if (this._checkLinking()) {
             this._sendLinking(method, param, callback);
@@ -144,7 +142,7 @@
             if (this._receives[method]) {
                 if (marker) {
                     this._receives[method](param, (param2) => {
-                        this._sendTelling(method, param2, marker);
+                        this._sendTelling(method, param2 || {}, marker);
                     });
                 } else {
                     this._receives[method](param);
@@ -167,7 +165,7 @@
             return;
         }
         // 发送
-        window.linking(JSON.stringify({
+        window.aisim.linking(JSON.stringify({
             method,
             param,
             marker,

--
Gitblit v1.9.1