yach.open.jssdk 4.3.8 → 4.4.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/yach_jssdk_4.4.0-beta.1.js +1 -0
- package/es/api/app/custom/talYoungFilesUpload.js +0 -2
- package/es/api/biz/chat/chooseConversationByCorpId.js +0 -2
- package/es/api/biz/chat/openSingleChat.js +0 -2
- package/es/api/biz/chat/openSquad.js +0 -2
- package/es/api/biz/chat/openTeamChat.js +0 -2
- package/es/api/biz/chat/pickConversation.js +0 -2
- package/es/api/biz/chat/sendP2PMsg.js +0 -2
- package/es/api/biz/contact/complexPicker.js +0 -2
- package/es/api/biz/contact/departmentsPicker.js +0 -2
- package/es/api/biz/group/groupComplexPicker.js +0 -2
- package/es/api/biz/map/multipointView.js +0 -2
- package/es/api/biz/map/view.js +0 -2
- package/es/api/biz/navigation/close.js +0 -2
- package/es/api/biz/navigation/goBack.js +0 -2
- package/es/api/biz/navigation/quit.js +0 -2
- package/es/api/biz/navigation/replace.js +0 -2
- package/es/api/biz/navigation/setIcon.js +0 -2
- package/es/api/biz/navigation/setLeft.js +0 -2
- package/es/api/biz/navigation/setMenu.js +0 -2
- package/es/api/biz/navigation/setPanGestureEnable.js +0 -2
- package/es/api/biz/navigation/setRight.js +0 -2
- package/es/api/biz/navigation/setTitle.js +0 -2
- package/es/api/biz/navigation/setTitleExpandIcon.js +0 -2
- package/es/api/biz/navigation/setWindowBig.js +0 -2
- package/es/api/biz/navigation/tencentMeeting.js +0 -2
- package/es/api/biz/navigation/tencentMeetingBegin.js +0 -2
- package/es/api/biz/navigation/updateExpandTitle.js +0 -2
- package/es/api/biz/telephone/call.js +0 -2
- package/es/api/biz/telephone/showCallMenu.js +0 -2
- package/es/api/biz/util/addAppToNav.js +0 -2
- package/es/api/biz/util/assistantCreate.js +0 -2
- package/es/api/biz/util/authFinish.js +0 -2
- package/es/api/biz/util/authStart.js +0 -2
- package/es/api/biz/util/chosen.js +0 -2
- package/es/api/biz/util/clipboardFileUpload.js +0 -2
- package/es/api/biz/util/closeWindow.js +0 -2
- package/es/api/biz/util/complain.js +0 -2
- package/es/api/biz/util/createModifySchedule.js +0 -2
- package/es/api/biz/util/datepicker.js +0 -2
- package/es/api/biz/util/datetimepicker.js +0 -2
- package/es/api/biz/util/disableScreenCapture.js +0 -2
- package/es/api/biz/util/downloadFile.js +0 -2
- package/es/api/biz/util/entergroupCheck.js +0 -2
- package/es/api/biz/util/externalLinkPreviewFile.js +0 -2
- package/es/api/biz/util/feedback.js +0 -2
- package/es/api/biz/util/getSingleWebviewData.js +0 -2
- package/es/api/biz/util/getTogetherConfig.js +0 -2
- package/es/api/biz/util/getToken.js +0 -2
- package/es/api/biz/util/injectScript.js +0 -2
- package/es/api/biz/util/invoice.js +0 -2
- package/es/api/biz/util/knowledgeBaseSelect.d.ts +21 -0
- package/es/api/biz/util/knowledgeBaseSelect.js +15 -0
- package/es/api/biz/util/mediaFileUpload.js +0 -2
- package/es/api/biz/util/onlineDocmentOpenTeamChat.js +0 -2
- package/es/api/biz/util/open.js +0 -2
- package/es/api/biz/util/openFutureGroup.js +0 -2
- package/es/api/biz/util/openLink.js +0 -2
- package/es/api/biz/util/openMediaFileDialog.js +0 -2
- package/es/api/biz/util/openSingleWebview.js +0 -2
- package/es/api/biz/util/openSlidePanel.js +0 -2
- package/es/api/biz/util/openTalYoungToTopic.js +0 -2
- package/es/api/biz/util/openTogetherEyeWebview.js +0 -2
- package/es/api/biz/util/openUserSchedule.js +0 -2
- package/es/api/biz/util/openVideoPlayer.js +0 -2
- package/es/api/biz/util/previewFile.js +0 -2
- package/es/api/biz/util/previewImage.js +0 -2
- package/es/api/biz/util/proxy.js +0 -2
- package/es/api/biz/util/pushWorkMsg.js +0 -2
- package/es/api/biz/util/remind.js +0 -2
- package/es/api/biz/util/resetSessionUnread.js +0 -2
- package/es/api/biz/util/rouseApp.js +0 -2
- package/es/api/biz/util/savePic.js +0 -2
- package/es/api/biz/util/scan.js +0 -2
- package/es/api/biz/util/selectDepartment.js +0 -2
- package/es/api/biz/util/share.js +0 -2
- package/es/api/biz/util/takePicture.js +0 -2
- package/es/api/biz/util/uploadAttachment.js +0 -2
- package/es/api/biz/util/yachEvent.js +0 -2
- package/es/api/biz/util/zfbAuth.js +0 -2
- package/es/api/biz/webViewMessage/send.js +0 -2
- package/es/api/device/audio/download.js +0 -2
- package/es/api/device/audio/onPlayEnd.js +0 -2
- package/es/api/device/audio/onRecordEnd.js +0 -2
- package/es/api/device/audio/onRecordEnd_v2.js +0 -2
- package/es/api/device/audio/pause.js +0 -2
- package/es/api/device/audio/play.js +0 -2
- package/es/api/device/audio/resume.js +0 -2
- package/es/api/device/audio/startRecord.js +0 -2
- package/es/api/device/audio/startRecord_v2.js +0 -2
- package/es/api/device/audio/stop.js +0 -2
- package/es/api/device/audio/stopRecord.js +0 -2
- package/es/api/device/audio/stopRecord_v2.js +0 -2
- package/es/api/device/base/checkStepPermission.js +0 -2
- package/es/api/device/base/getPhoneInfo.js +0 -2
- package/es/api/device/base/getUUID.js +0 -2
- package/es/api/device/connection/getNetworkType.js +0 -2
- package/es/api/device/connection/isAtTal.js +2 -4
- package/es/api/device/geolocation/get.js +0 -2
- package/es/api/device/geolocation/getSwitch.js +0 -2
- package/es/api/device/notification/actionSheet.js +0 -2
- package/es/api/device/notification/alert.js +0 -2
- package/es/api/device/notification/confirm.js +0 -2
- package/es/api/device/notification/hidePreloader.js +0 -2
- package/es/api/device/notification/showPreloader.js +0 -2
- package/es/api/device/notification/toast.js +0 -2
- package/es/api/device/notification/vibrate.js +0 -2
- package/es/api/device/system/getLang.js +0 -2
- package/es/api/device/system/setLight.js +0 -2
- package/es/api/initAPI.js +3 -5
- package/es/api/primary/createTab.js +0 -2
- package/es/api/primary/exitFullScreen.js +0 -2
- package/es/api/primary/fullScreen.js +0 -2
- package/es/api/primary/weeklyShare.js +0 -2
- package/es/api/runtime/permission/requestAuthCode.js +0 -2
- package/es/api/ui/pullToRefresh/disable.js +0 -2
- package/es/api/ui/pullToRefresh/enable.js +0 -2
- package/es/api/ui/pullToRefresh/stop.js +0 -2
- package/es/api/ui/webViewBounce/disable.js +0 -2
- package/es/api/util/domainStorage/getItem.js +0 -2
- package/es/api/util/domainStorage/removeItem.js +0 -2
- package/es/api/util/domainStorage/setItem.js +0 -2
- package/es/api/util/tool/flushLog.js +0 -2
- package/es/api/util/tool/log.js +0 -2
- package/es/index.d.ts +3 -1
- package/es/index.js +18 -27
- package/es/lib/bridge/mobile.js +8 -23
- package/es/lib/bridge/pc.js +16 -17
- package/es/lib/helper/apiHelper.js +0 -2
- package/es/lib/helper/codeMap.js +0 -2
- package/es/lib/helper/event.js +0 -13
- package/es/lib/helper/pcIframe.js +14 -45
- package/es/lib/index.js +7 -21
- package/es/lib/sdk/index.js +14 -35
- package/es/lib/sdk/sdk.typings.js +0 -1
- package/es/utils/bpitLog.js +4 -13
- package/es/utils/compareVersions.js +23 -50
- package/es/utils/console.js +0 -15
- package/es/utils/env.js +12 -19
- package/es/utils/index.js +0 -5
- package/libs/api/app/custom/talYoungFilesUpload.js +1 -6
- package/libs/api/biz/chat/chooseConversationByCorpId.js +0 -6
- package/libs/api/biz/chat/openSingleChat.js +0 -6
- package/libs/api/biz/chat/openSquad.js +0 -6
- package/libs/api/biz/chat/openTeamChat.js +0 -6
- package/libs/api/biz/chat/pickConversation.js +0 -6
- package/libs/api/biz/chat/sendP2PMsg.js +0 -6
- package/libs/api/biz/contact/complexPicker.js +0 -6
- package/libs/api/biz/contact/departmentsPicker.js +0 -6
- package/libs/api/biz/group/groupComplexPicker.js +0 -6
- package/libs/api/biz/map/multipointView.js +0 -6
- package/libs/api/biz/map/view.js +0 -6
- package/libs/api/biz/navigation/close.js +0 -6
- package/libs/api/biz/navigation/goBack.js +0 -6
- package/libs/api/biz/navigation/quit.js +0 -6
- package/libs/api/biz/navigation/replace.js +0 -6
- package/libs/api/biz/navigation/setIcon.js +0 -7
- package/libs/api/biz/navigation/setLeft.js +0 -7
- package/libs/api/biz/navigation/setMenu.js +0 -7
- package/libs/api/biz/navigation/setPanGestureEnable.js +0 -7
- package/libs/api/biz/navigation/setRight.js +0 -7
- package/libs/api/biz/navigation/setTitle.js +0 -6
- package/libs/api/biz/navigation/setTitleExpandIcon.js +0 -7
- package/libs/api/biz/navigation/setWindowBig.js +1 -6
- package/libs/api/biz/navigation/tencentMeeting.js +0 -6
- package/libs/api/biz/navigation/tencentMeetingBegin.js +0 -6
- package/libs/api/biz/navigation/updateExpandTitle.js +0 -6
- package/libs/api/biz/telephone/call.js +0 -6
- package/libs/api/biz/telephone/showCallMenu.js +0 -6
- package/libs/api/biz/util/addAppToNav.js +0 -6
- package/libs/api/biz/util/assistantCreate.js +0 -6
- package/libs/api/biz/util/authFinish.js +0 -6
- package/libs/api/biz/util/authStart.js +0 -6
- package/libs/api/biz/util/chosen.js +0 -6
- package/libs/api/biz/util/clipboardFileUpload.js +0 -6
- package/libs/api/biz/util/closeWindow.js +0 -6
- package/libs/api/biz/util/complain.js +0 -6
- package/libs/api/biz/util/createModifySchedule.js +0 -6
- package/libs/api/biz/util/datepicker.js +0 -6
- package/libs/api/biz/util/datetimepicker.js +0 -6
- package/libs/api/biz/util/disableScreenCapture.js +0 -6
- package/libs/api/biz/util/downloadFile.js +0 -6
- package/libs/api/biz/util/entergroupCheck.js +0 -6
- package/libs/api/biz/util/externalLinkPreviewFile.js +0 -6
- package/libs/api/biz/util/feedback.js +0 -6
- package/libs/api/biz/util/getSingleWebviewData.js +0 -6
- package/libs/api/biz/util/getTogetherConfig.js +0 -6
- package/libs/api/biz/util/getToken.js +0 -6
- package/libs/api/biz/util/injectScript.js +0 -6
- package/libs/api/biz/util/invoice.js +1 -6
- package/libs/api/biz/util/knowledgeBaseSelect.d.ts +21 -0
- package/libs/api/biz/util/knowledgeBaseSelect.js +22 -0
- package/libs/api/biz/util/mediaFileUpload.js +1 -6
- package/libs/api/biz/util/onlineDocmentOpenTeamChat.js +0 -6
- package/libs/api/biz/util/open.js +0 -6
- package/libs/api/biz/util/openFutureGroup.js +0 -6
- package/libs/api/biz/util/openLink.js +0 -6
- package/libs/api/biz/util/openMediaFileDialog.js +1 -6
- package/libs/api/biz/util/openSingleWebview.js +0 -6
- package/libs/api/biz/util/openSlidePanel.js +0 -6
- package/libs/api/biz/util/openTalYoungToTopic.js +1 -6
- package/libs/api/biz/util/openTogetherEyeWebview.js +0 -6
- package/libs/api/biz/util/openUserSchedule.js +0 -6
- package/libs/api/biz/util/openVideoPlayer.js +0 -6
- package/libs/api/biz/util/previewFile.js +0 -6
- package/libs/api/biz/util/previewImage.js +0 -6
- package/libs/api/biz/util/proxy.js +0 -6
- package/libs/api/biz/util/pushWorkMsg.js +1 -6
- package/libs/api/biz/util/remind.js +0 -6
- package/libs/api/biz/util/resetSessionUnread.js +0 -6
- package/libs/api/biz/util/rouseApp.js +1 -6
- package/libs/api/biz/util/savePic.js +0 -6
- package/libs/api/biz/util/scan.js +0 -6
- package/libs/api/biz/util/selectDepartment.js +0 -6
- package/libs/api/biz/util/share.js +0 -6
- package/libs/api/biz/util/takePicture.js +0 -6
- package/libs/api/biz/util/uploadAttachment.js +0 -6
- package/libs/api/biz/util/yachEvent.js +0 -6
- package/libs/api/biz/util/zfbAuth.js +0 -6
- package/libs/api/biz/webViewMessage/send.js +0 -6
- package/libs/api/device/audio/download.js +0 -6
- package/libs/api/device/audio/onPlayEnd.js +0 -6
- package/libs/api/device/audio/onRecordEnd.js +0 -6
- package/libs/api/device/audio/onRecordEnd_v2.js +0 -6
- package/libs/api/device/audio/pause.js +0 -6
- package/libs/api/device/audio/play.js +0 -6
- package/libs/api/device/audio/resume.js +0 -6
- package/libs/api/device/audio/startRecord.js +0 -6
- package/libs/api/device/audio/startRecord_v2.js +0 -6
- package/libs/api/device/audio/stop.js +0 -6
- package/libs/api/device/audio/stopRecord.js +0 -6
- package/libs/api/device/audio/stopRecord_v2.js +0 -6
- package/libs/api/device/base/checkStepPermission.js +0 -6
- package/libs/api/device/base/getPhoneInfo.js +0 -6
- package/libs/api/device/base/getUUID.js +0 -6
- package/libs/api/device/connection/getNetworkType.js +0 -6
- package/libs/api/device/connection/isAtTal.js +2 -8
- package/libs/api/device/geolocation/get.js +0 -6
- package/libs/api/device/geolocation/getSwitch.js +0 -6
- package/libs/api/device/notification/actionSheet.js +0 -6
- package/libs/api/device/notification/alert.js +0 -6
- package/libs/api/device/notification/confirm.js +0 -6
- package/libs/api/device/notification/hidePreloader.js +0 -6
- package/libs/api/device/notification/showPreloader.js +0 -6
- package/libs/api/device/notification/toast.js +0 -6
- package/libs/api/device/notification/vibrate.js +0 -6
- package/libs/api/device/system/getLang.js +0 -6
- package/libs/api/device/system/setLight.js +0 -6
- package/libs/api/initAPI.js +4 -13
- package/libs/api/primary/createTab.js +0 -6
- package/libs/api/primary/exitFullScreen.js +0 -6
- package/libs/api/primary/fullScreen.js +0 -6
- package/libs/api/primary/weeklyShare.js +0 -6
- package/libs/api/runtime/permission/requestAuthCode.js +0 -6
- package/libs/api/ui/pullToRefresh/disable.js +0 -6
- package/libs/api/ui/pullToRefresh/enable.js +0 -6
- package/libs/api/ui/pullToRefresh/stop.js +0 -6
- package/libs/api/ui/webViewBounce/disable.js +0 -6
- package/libs/api/util/domainStorage/getItem.js +0 -6
- package/libs/api/util/domainStorage/removeItem.js +0 -6
- package/libs/api/util/domainStorage/setItem.js +0 -6
- package/libs/api/util/tool/flushLog.js +0 -6
- package/libs/api/util/tool/log.js +0 -6
- package/libs/index.d.ts +3 -1
- package/libs/index.js +21 -285
- package/libs/lib/bridge/index.js +0 -7
- package/libs/lib/bridge/mobile.js +11 -45
- package/libs/lib/bridge/pc.js +19 -33
- package/libs/lib/helper/apiHelper.js +0 -6
- package/libs/lib/helper/codeMap.js +0 -6
- package/libs/lib/helper/event.js +1 -22
- package/libs/lib/helper/pcIframe.js +13 -51
- package/libs/lib/index.js +8 -32
- package/libs/lib/sdk/index.js +15 -45
- package/libs/lib/sdk/sdk.typings.js +0 -4
- package/libs/utils/bpitLog.js +4 -16
- package/libs/utils/compareVersions.js +27 -72
- package/libs/utils/console.js +0 -16
- package/libs/utils/env.js +12 -21
- package/libs/utils/index.js +0 -13
- package/package.json +1 -1
- package/dist/yach_jssdk_4.3.8.js +0 -1
package/libs/lib/bridge/index.js
CHANGED
|
@@ -1,39 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
|
|
4
|
-
|
|
5
4
|
_Object$defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
|
|
9
7
|
_Object$defineProperty(exports, "PcBridgeInit", {
|
|
10
8
|
enumerable: true,
|
|
11
9
|
get: function get() {
|
|
12
10
|
return _pc.PcBridgeInit;
|
|
13
11
|
}
|
|
14
12
|
});
|
|
15
|
-
|
|
16
13
|
_Object$defineProperty(exports, "mobileBridge", {
|
|
17
14
|
enumerable: true,
|
|
18
15
|
get: function get() {
|
|
19
16
|
return _mobile.mobileBridge;
|
|
20
17
|
}
|
|
21
18
|
});
|
|
22
|
-
|
|
23
19
|
_Object$defineProperty(exports, "mobileBridgeInit", {
|
|
24
20
|
enumerable: true,
|
|
25
21
|
get: function get() {
|
|
26
22
|
return _mobile.mobileBridgeInit;
|
|
27
23
|
}
|
|
28
24
|
});
|
|
29
|
-
|
|
30
25
|
_Object$defineProperty(exports, "pcBridge", {
|
|
31
26
|
enumerable: true,
|
|
32
27
|
get: function get() {
|
|
33
28
|
return _pc.pcBridge;
|
|
34
29
|
}
|
|
35
30
|
});
|
|
36
|
-
|
|
37
31
|
var _mobile = require("./mobile");
|
|
38
|
-
|
|
39
32
|
var _pc = require("./pc");
|
|
@@ -1,44 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
5
|
_Object$defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
|
|
11
8
|
exports.mobileBridgeInit = exports.mobileBridge = void 0;
|
|
12
|
-
|
|
13
9
|
var _setTimeout2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/set-timeout"));
|
|
14
|
-
|
|
15
10
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/promise"));
|
|
16
|
-
|
|
17
11
|
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/object/assign"));
|
|
18
|
-
|
|
19
12
|
var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/parse-int"));
|
|
20
|
-
|
|
21
13
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/json/stringify"));
|
|
22
|
-
|
|
23
14
|
var _event = _interopRequireDefault(require("../helper/event"));
|
|
24
|
-
|
|
25
15
|
var _codeMap = require("../helper/codeMap");
|
|
26
|
-
|
|
27
16
|
var _utils = require("../../utils");
|
|
28
|
-
|
|
29
17
|
function setupWebViewJavascriptBridge(callback) {
|
|
30
18
|
if (window.WebViewJavascriptBridge) {
|
|
31
19
|
return callback(WebViewJavascriptBridge);
|
|
32
20
|
}
|
|
33
|
-
|
|
34
21
|
if (window.WKWebViewJavascriptBridge) {
|
|
35
22
|
return callback(WKWebViewJavascriptBridge);
|
|
36
23
|
}
|
|
37
|
-
|
|
38
24
|
if (window.WVJBCallbacks) {
|
|
39
25
|
return window.WVJBCallbacks.push(callback);
|
|
40
26
|
}
|
|
41
|
-
|
|
42
27
|
window.WVJBCallbacks = [callback];
|
|
43
28
|
var WVJBIframe = document.createElement('iframe');
|
|
44
29
|
WVJBIframe.style.display = 'none';
|
|
@@ -48,8 +33,7 @@ function setupWebViewJavascriptBridge(callback) {
|
|
|
48
33
|
document.documentElement.removeChild(WVJBIframe);
|
|
49
34
|
}, 0);
|
|
50
35
|
}
|
|
51
|
-
|
|
52
|
-
var mobileBridgeInit = function mobileBridgeInit() {
|
|
36
|
+
var mobileBridgeInit = exports.mobileBridgeInit = function mobileBridgeInit() {
|
|
53
37
|
return new _promise["default"](function (resolve, reject) {
|
|
54
38
|
setupWebViewJavascriptBridge(function (bridge) {
|
|
55
39
|
(0, _utils.log)("\u6CE8\u518Cresume\u4E8B\u4EF6 ");
|
|
@@ -57,7 +41,6 @@ var mobileBridgeInit = function mobileBridgeInit() {
|
|
|
57
41
|
(0, _utils.log)("resume\u76D1\u542C\u5230\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
58
42
|
resData: resData
|
|
59
43
|
});
|
|
60
|
-
|
|
61
44
|
_event["default"].execEvent('resume', resData);
|
|
62
45
|
});
|
|
63
46
|
(0, _utils.log)("\u6CE8\u518CunreadMsgAction\u4E8B\u4EF6 ");
|
|
@@ -65,7 +48,6 @@ var mobileBridgeInit = function mobileBridgeInit() {
|
|
|
65
48
|
(0, _utils.log)("unreadMsgAction\u76D1\u542C\u5230\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
66
49
|
resData: resData
|
|
67
50
|
});
|
|
68
|
-
|
|
69
51
|
_event["default"].execEvent('unreadMsgAction', resData);
|
|
70
52
|
});
|
|
71
53
|
(0, _utils.log)("\u6CE8\u518CwebViewMsgReceive\u4E8B\u4EF6 ");
|
|
@@ -73,38 +55,31 @@ var mobileBridgeInit = function mobileBridgeInit() {
|
|
|
73
55
|
(0, _utils.log)("webViewMsgReceive\u76D1\u542C\u5230\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
74
56
|
resData: resData
|
|
75
57
|
});
|
|
76
|
-
|
|
77
58
|
_event["default"].execEvent('webViewMsgReceive', resData);
|
|
78
59
|
});
|
|
79
60
|
bridge.registerHandler('pushWorkMsg', function (resData) {
|
|
80
61
|
(0, _utils.log)("pushWorkMsg\u76D1\u542C\u5230\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
81
62
|
resData: resData
|
|
82
63
|
});
|
|
83
|
-
|
|
84
64
|
_event["default"].execEvent('pushWorkMsg', resData);
|
|
85
65
|
});
|
|
86
66
|
bridge.registerHandler('getTogetherCallback', function (resData) {
|
|
87
67
|
(0, _utils.log)("getTogetherCallback\u76D1\u542C\u5230\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
88
68
|
resData: resData
|
|
89
69
|
});
|
|
90
|
-
|
|
91
70
|
_event["default"].execEvent('getTogetherCallback', resData);
|
|
92
71
|
});
|
|
93
72
|
bridge.registerHandler('sendMsgCommon', function (resData) {
|
|
94
73
|
(0, _utils.log)("sendMsgCommon ", {
|
|
95
74
|
resData: resData
|
|
96
75
|
});
|
|
97
|
-
|
|
98
76
|
_event["default"].execEvent('sendMsgCommon', resData);
|
|
99
77
|
});
|
|
100
78
|
resolve();
|
|
101
79
|
});
|
|
102
80
|
});
|
|
103
81
|
};
|
|
104
|
-
|
|
105
|
-
exports.mobileBridgeInit = mobileBridgeInit;
|
|
106
|
-
|
|
107
|
-
var mobileBridge = function mobileBridge(method, param) {
|
|
82
|
+
var mobileBridge = exports.mobileBridge = function mobileBridge(method, param) {
|
|
108
83
|
return new _promise["default"](function (resolve, reject) {
|
|
109
84
|
var p = (0, _assign["default"])({}, param);
|
|
110
85
|
setupWebViewJavascriptBridge(function (bridge) {
|
|
@@ -112,7 +87,6 @@ var mobileBridge = function mobileBridge(method, param) {
|
|
|
112
87
|
bridge.registerHandler(method, function (data) {
|
|
113
88
|
var onSuccess = param.onSuccess;
|
|
114
89
|
delete p.onSuccess;
|
|
115
|
-
|
|
116
90
|
if ('function' === typeof onSuccess) {
|
|
117
91
|
onSuccess(data);
|
|
118
92
|
resolve({
|
|
@@ -122,14 +96,11 @@ var mobileBridge = function mobileBridge(method, param) {
|
|
|
122
96
|
}
|
|
123
97
|
});
|
|
124
98
|
}
|
|
125
|
-
|
|
126
99
|
bridge.callHandler(method, param, function (e) {
|
|
127
100
|
var code = e.code,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
101
|
+
message = e.message,
|
|
102
|
+
data = e.data;
|
|
131
103
|
var _code = (0, _parseInt2["default"])(code);
|
|
132
|
-
|
|
133
104
|
var callbackStr = (0, _codeMap.electronResCodeMap)(_code);
|
|
134
105
|
var callbackFun = p[callbackStr];
|
|
135
106
|
(0, _utils.log)("SDK\u6267\u884C\u540E\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
@@ -139,40 +110,37 @@ var mobileBridge = function mobileBridge(method, param) {
|
|
|
139
110
|
_code: _code,
|
|
140
111
|
message: message,
|
|
141
112
|
callbackFun: callbackFun
|
|
142
|
-
});
|
|
143
|
-
|
|
113
|
+
});
|
|
114
|
+
// 请求失败
|
|
144
115
|
if (callbackStr === 'onFail') {
|
|
145
116
|
(0, _utils.bpitLog)({
|
|
146
117
|
method: method,
|
|
147
118
|
errorcode: _code,
|
|
148
119
|
message: message || (0, _stringify["default"])(data) || 'SDK执行失败回调,相关参数'
|
|
149
120
|
});
|
|
150
|
-
|
|
151
121
|
if ('function' === typeof callbackFun) {
|
|
152
122
|
message ? callbackFun({
|
|
153
123
|
code: code,
|
|
154
124
|
message: message
|
|
155
125
|
}) : callbackFun(data);
|
|
156
126
|
}
|
|
157
|
-
|
|
158
127
|
reject({
|
|
159
128
|
_code: _code,
|
|
160
129
|
message: message,
|
|
161
130
|
data: data
|
|
162
131
|
});
|
|
163
132
|
return;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
|
|
133
|
+
}
|
|
134
|
+
// 请求成功
|
|
167
135
|
if ('function' === typeof callbackFun) {
|
|
168
136
|
callbackFun(data || message);
|
|
169
137
|
}
|
|
170
|
-
|
|
171
138
|
resolve({
|
|
172
139
|
_code: _code,
|
|
173
140
|
message: message,
|
|
174
141
|
data: data
|
|
175
|
-
});
|
|
142
|
+
});
|
|
143
|
+
// if (_code === -2 || _code === 7) {
|
|
176
144
|
// bpitLog({
|
|
177
145
|
// method,
|
|
178
146
|
// errorcode: _code,
|
|
@@ -204,6 +172,4 @@ var mobileBridge = function mobileBridge(method, param) {
|
|
|
204
172
|
});
|
|
205
173
|
});
|
|
206
174
|
});
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
exports.mobileBridge = mobileBridge;
|
|
175
|
+
};
|
package/libs/lib/bridge/pc.js
CHANGED
|
@@ -1,42 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
5
|
_Object$defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
|
|
11
8
|
exports.pcBridge = exports.PcBridgeInit = void 0;
|
|
12
|
-
|
|
13
9
|
var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/promise"));
|
|
14
|
-
|
|
15
10
|
var _parseInt2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/parse-int"));
|
|
16
|
-
|
|
17
11
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/json/stringify"));
|
|
18
|
-
|
|
12
|
+
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/object/assign"));
|
|
19
13
|
var _pcIframe = _interopRequireDefault(require("../helper/pcIframe"));
|
|
20
|
-
|
|
21
14
|
var _codeMap = require("../helper/codeMap");
|
|
22
|
-
|
|
23
15
|
var _utils = require("../../utils");
|
|
24
|
-
|
|
25
|
-
var PcBridgeInit = function PcBridgeInit() {
|
|
16
|
+
var PcBridgeInit = exports.PcBridgeInit = function PcBridgeInit() {
|
|
26
17
|
_pcIframe["default"].init();
|
|
27
18
|
};
|
|
28
|
-
|
|
29
|
-
exports.PcBridgeInit = PcBridgeInit;
|
|
30
|
-
|
|
31
|
-
var pcBridge = function pcBridge(method, param) {
|
|
19
|
+
var pcBridge = exports.pcBridge = function pcBridge(method, param) {
|
|
32
20
|
return new _promise["default"](function (resolve, reject) {
|
|
33
21
|
return _pcIframe["default"].invokeAPI(method, param, function (_ref) {
|
|
34
22
|
var data = _ref.data,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
23
|
+
code = _ref.code,
|
|
24
|
+
message = _ref.message;
|
|
38
25
|
var _code = (0, _parseInt2["default"])(code);
|
|
39
|
-
|
|
40
26
|
var callbackStr = (0, _codeMap.electronResCodeMap)(_code);
|
|
41
27
|
var callbackFun = param[callbackStr];
|
|
42
28
|
(0, _utils.log)("SDK\u6267\u884C\u540E\u56DE\u8C03\uFF0C\u76F8\u5173\u53C2\u6570 ", {
|
|
@@ -46,41 +32,43 @@ var pcBridge = function pcBridge(method, param) {
|
|
|
46
32
|
_code: _code,
|
|
47
33
|
message: message,
|
|
48
34
|
callbackFun: callbackFun
|
|
49
|
-
});
|
|
50
|
-
|
|
35
|
+
});
|
|
36
|
+
// 请求失败
|
|
51
37
|
if (callbackStr === 'onFail') {
|
|
52
38
|
(0, _utils.bpitLog)({
|
|
53
39
|
method: method,
|
|
54
40
|
errorcode: _code,
|
|
55
41
|
message: message || (0, _stringify["default"])(data) || 'SDK执行失败回调,相关参数'
|
|
56
42
|
});
|
|
57
|
-
|
|
58
43
|
if ('function' === typeof callbackFun) {
|
|
59
44
|
console.log('wenai-code', code, _code);
|
|
60
|
-
|
|
45
|
+
var callbackData = Object.prototype.toString.call(data) === "[object Object]" ? (0, _assign["default"])((0, _assign["default"])({}, data), {
|
|
61
46
|
code: code,
|
|
62
47
|
message: message
|
|
63
|
-
}) :
|
|
48
|
+
}) : {
|
|
49
|
+
data: data,
|
|
50
|
+
code: code,
|
|
51
|
+
message: message
|
|
52
|
+
};
|
|
53
|
+
message ? callbackFun(callbackData) : callbackFun(data);
|
|
64
54
|
}
|
|
65
|
-
|
|
66
55
|
reject({
|
|
67
56
|
_code: _code,
|
|
68
57
|
message: message,
|
|
69
58
|
data: data
|
|
70
59
|
});
|
|
71
60
|
return;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
61
|
+
}
|
|
62
|
+
// 请求成功
|
|
75
63
|
if ('function' === typeof callbackFun) {
|
|
76
64
|
callbackFun(data || message);
|
|
77
65
|
}
|
|
78
|
-
|
|
79
66
|
resolve({
|
|
80
67
|
_code: _code,
|
|
81
68
|
message: message,
|
|
82
69
|
data: data
|
|
83
|
-
});
|
|
70
|
+
});
|
|
71
|
+
// if (_code === -2) {
|
|
84
72
|
// bpitLog({
|
|
85
73
|
// method,
|
|
86
74
|
// errorcode: _code,
|
|
@@ -102,6 +90,4 @@ var pcBridge = function pcBridge(method, param) {
|
|
|
102
90
|
// resolve({ _code, message, data });
|
|
103
91
|
});
|
|
104
92
|
});
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
exports.pcBridge = pcBridge;
|
|
93
|
+
};
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
5
|
_Object$defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
|
|
11
8
|
exports.genDefaultParamsDealFn = genDefaultParamsDealFn;
|
|
12
|
-
|
|
13
9
|
var _assign = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/object/assign"));
|
|
14
|
-
|
|
15
10
|
function genDefaultParamsDealFn(p) {
|
|
16
11
|
return function (r) {
|
|
17
12
|
return (0, _assign["default"])((0, _assign["default"])({}, p), r);
|
|
18
13
|
};
|
|
19
14
|
}
|
|
20
|
-
|
|
21
15
|
;
|
|
@@ -1,19 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
5
|
_Object$defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
|
|
11
8
|
exports.electronResCodeMap = electronResCodeMap;
|
|
12
|
-
|
|
13
9
|
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/map"));
|
|
14
|
-
|
|
15
10
|
var resCodeMap = new _map["default"]([[0, 'onSuccess'], [-1, 'onCancel'], [-2, 'onFail'], [-3, 'onProgress'], [-4, 'onSubmit']]);
|
|
16
|
-
|
|
17
11
|
function electronResCodeMap(code) {
|
|
18
12
|
return resCodeMap.get(code) || 'onFail';
|
|
19
13
|
}
|
package/libs/lib/helper/event.js
CHANGED
|
@@ -1,58 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
5
|
_Object$defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
|
|
11
8
|
exports["default"] = void 0;
|
|
12
|
-
|
|
13
9
|
var _isArray = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/array/is-array"));
|
|
14
|
-
|
|
15
10
|
var _indexOf = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/index-of"));
|
|
16
|
-
|
|
17
11
|
var _splice = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/splice"));
|
|
18
|
-
|
|
19
12
|
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/instance/for-each"));
|
|
20
|
-
|
|
21
13
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
22
|
-
|
|
23
14
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
24
|
-
|
|
25
15
|
var Event = /*#__PURE__*/(0, _createClass2["default"])(function Event() {
|
|
26
16
|
var _this = this;
|
|
27
|
-
|
|
28
17
|
(0, _classCallCheck2["default"])(this, Event);
|
|
29
|
-
|
|
30
18
|
this.on = function (event, fn) {
|
|
31
19
|
if (!event || 'function' !== typeof fn) throw 'eventName is null or handle is not a function, on fail';
|
|
32
20
|
if (!(0, _isArray["default"])(_this.eventsHandle[event])) _this.eventsHandle[event] = [];
|
|
33
|
-
|
|
34
21
|
_this.eventsHandle[event].push(fn);
|
|
35
22
|
};
|
|
36
|
-
|
|
37
23
|
this.off = function (event, fn) {
|
|
38
24
|
if (!event) throw 'eventName is null, invoke off fail';
|
|
39
|
-
|
|
40
25
|
if (!fn) {
|
|
41
26
|
_this.eventsHandle[event] = [];
|
|
42
27
|
return;
|
|
43
28
|
}
|
|
44
|
-
|
|
45
29
|
if ((0, _isArray["default"])(_this.eventsHandle[event])) {
|
|
46
30
|
var _context, _context2;
|
|
47
|
-
|
|
48
31
|
var n = (0, _indexOf["default"])(_context = _this.eventsHandle[event]).call(_context, fn);
|
|
49
32
|
-1 !== n && (0, _splice["default"])(_context2 = _this.eventsHandle[event]).call(_context2, n, 1);
|
|
50
33
|
}
|
|
51
34
|
};
|
|
52
|
-
|
|
53
35
|
this.execEvent = function (event, data) {
|
|
54
36
|
var _context3;
|
|
55
|
-
|
|
56
37
|
(0, _isArray["default"])(this.eventsHandle[event]) && (0, _forEach["default"])(_context3 = this.eventsHandle[event]).call(_context3, function (fn) {
|
|
57
38
|
try {
|
|
58
39
|
fn(data);
|
|
@@ -61,9 +42,7 @@ var Event = /*#__PURE__*/(0, _createClass2["default"])(function Event() {
|
|
|
61
42
|
}
|
|
62
43
|
});
|
|
63
44
|
};
|
|
64
|
-
|
|
65
45
|
this.eventsHandle = {};
|
|
66
46
|
});
|
|
67
47
|
var event = new Event();
|
|
68
|
-
var _default = event;
|
|
69
|
-
exports["default"] = _default;
|
|
48
|
+
var _default = exports["default"] = event;
|
|
@@ -1,44 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _Object$defineProperty = require("@babel/runtime-corejs3/core-js/object/define-property");
|
|
4
|
-
|
|
5
4
|
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
5
|
_Object$defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
10
|
-
|
|
11
8
|
exports["default"] = void 0;
|
|
12
|
-
|
|
13
9
|
var _now = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/date/now"));
|
|
14
|
-
|
|
15
10
|
var _stringify = _interopRequireDefault(require("@babel/runtime-corejs3/core-js/json/stringify"));
|
|
16
|
-
|
|
17
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/createClass"));
|
|
18
|
-
|
|
19
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/classCallCheck"));
|
|
20
|
-
|
|
21
13
|
var _utils = require("../../utils");
|
|
22
|
-
|
|
23
14
|
var _event = _interopRequireDefault(require("./event"));
|
|
24
|
-
|
|
25
15
|
// 处理posmessage参数
|
|
26
16
|
var GenPostMsg = /*#__PURE__*/(0, _createClass2["default"])(function GenPostMsg(method, param, callback) {
|
|
27
17
|
var _this = this;
|
|
28
|
-
|
|
29
18
|
(0, _classCallCheck2["default"])(this, GenPostMsg);
|
|
30
|
-
|
|
31
19
|
this.genid = function () {
|
|
32
20
|
var idStr = (0, _now["default"])().toString(36);
|
|
33
21
|
idStr += Math.random().toString(36).substr(3);
|
|
34
22
|
return idStr;
|
|
35
23
|
};
|
|
36
|
-
|
|
37
24
|
this.receiveResponse = function (data) {
|
|
38
25
|
//this.PromiseObj.resolve(data);
|
|
39
26
|
_this.callback(data);
|
|
40
27
|
};
|
|
41
|
-
|
|
42
28
|
this.getPayload = function () {
|
|
43
29
|
return {
|
|
44
30
|
msgId: _this.id,
|
|
@@ -48,7 +34,6 @@ var GenPostMsg = /*#__PURE__*/(0, _createClass2["default"])(function GenPostMsg(
|
|
|
48
34
|
invokeType: _this.invokeType
|
|
49
35
|
};
|
|
50
36
|
};
|
|
51
|
-
|
|
52
37
|
this.id = this.genid();
|
|
53
38
|
this.PromiseObj = {
|
|
54
39
|
resolve: null,
|
|
@@ -57,7 +42,8 @@ var GenPostMsg = /*#__PURE__*/(0, _createClass2["default"])(function GenPostMsg(
|
|
|
57
42
|
this.methodName = method;
|
|
58
43
|
this.plainMsg = param;
|
|
59
44
|
this.invokeType = param === null || param === void 0 ? void 0 : param.invokeType;
|
|
60
|
-
this.callback = callback;
|
|
45
|
+
this.callback = callback;
|
|
46
|
+
// this.result = new Promise(
|
|
61
47
|
// function (resolve, reject) {
|
|
62
48
|
// this.PromiseObj = {
|
|
63
49
|
// resolve,
|
|
@@ -68,76 +54,59 @@ var GenPostMsg = /*#__PURE__*/(0, _createClass2["default"])(function GenPostMsg(
|
|
|
68
54
|
});
|
|
69
55
|
var Frame = /*#__PURE__*/(0, _createClass2["default"])(function Frame() {
|
|
70
56
|
var _this2 = this;
|
|
71
|
-
|
|
72
57
|
(0, _classCallCheck2["default"])(this, Frame);
|
|
73
|
-
|
|
74
58
|
this.addPending = function (e) {
|
|
75
59
|
_this2.pendingMsgs[e.id] = e;
|
|
76
60
|
};
|
|
77
|
-
|
|
78
61
|
this.deletePending = function (e) {
|
|
79
62
|
delete _this2.pendingMsgs[e.id];
|
|
80
63
|
};
|
|
81
|
-
|
|
82
64
|
this.getPending = function (t) {
|
|
83
65
|
return this.pendingMsgs[t];
|
|
84
66
|
};
|
|
85
|
-
|
|
86
67
|
this.invokeAPIInBrowserView = function (payload) {
|
|
87
68
|
window.sendTo(payload);
|
|
88
69
|
};
|
|
89
|
-
|
|
90
70
|
this.invokeAPIInWebview = function (payload) {
|
|
91
71
|
window.sendToHost(payload);
|
|
92
72
|
};
|
|
93
|
-
|
|
94
73
|
this.invokeAPI = function (method, param, callback) {
|
|
95
74
|
var genPostMsg = new GenPostMsg(method, param, callback);
|
|
96
75
|
var payload = (0, _stringify["default"])(genPostMsg.getPayload());
|
|
97
76
|
var _param$invokeType = param.invokeType,
|
|
98
|
-
|
|
77
|
+
invokeType = _param$invokeType === void 0 ? '' : _param$invokeType;
|
|
99
78
|
invokeType === 'browserView' ? _this2.invokeAPIInBrowserView(payload) : _this2.invokeAPIInWebview(payload);
|
|
100
|
-
|
|
101
79
|
_this2.addPending(genPostMsg);
|
|
102
|
-
|
|
103
80
|
return genPostMsg;
|
|
104
81
|
};
|
|
105
|
-
|
|
106
82
|
this.handleCallback = function (datas, invokeType) {
|
|
107
83
|
var type = datas.type,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
84
|
+
methodName = datas.methodName,
|
|
85
|
+
eventName = datas.eventName,
|
|
86
|
+
msgId = datas.msgId,
|
|
87
|
+
_datas$data = datas.data,
|
|
88
|
+
data = _datas$data === void 0 ? {} : _datas$data,
|
|
89
|
+
code = datas.code,
|
|
90
|
+
message = datas.message,
|
|
91
|
+
msg = datas.msg;
|
|
117
92
|
if (type === 'request') {
|
|
118
93
|
// 壳子的调用
|
|
119
94
|
switch (methodName) {
|
|
120
95
|
case 'refresh':
|
|
121
96
|
window.location.reload();
|
|
122
97
|
break;
|
|
123
|
-
|
|
124
98
|
case 'back':
|
|
125
99
|
window.history.back();
|
|
126
100
|
break;
|
|
127
|
-
|
|
128
101
|
case 'forward':
|
|
129
102
|
window.history.forward();
|
|
130
103
|
break;
|
|
131
|
-
|
|
132
104
|
case 'event':
|
|
133
105
|
_event["default"].execEvent(eventName, data);
|
|
134
|
-
|
|
135
106
|
break;
|
|
136
|
-
|
|
137
107
|
case 'zoomInClick':
|
|
138
108
|
var scrollTopVal = document.documentElement.scrollTop || document.body.scrollTop,
|
|
139
|
-
|
|
140
|
-
|
|
109
|
+
url = window.location.href;
|
|
141
110
|
if (invokeType === 'browserView') {
|
|
142
111
|
window.sendTo((0, _stringify["default"])({
|
|
143
112
|
type: type,
|
|
@@ -159,16 +128,13 @@ var Frame = /*#__PURE__*/(0, _createClass2["default"])(function Frame() {
|
|
|
159
128
|
}
|
|
160
129
|
}));
|
|
161
130
|
}
|
|
162
|
-
|
|
163
131
|
break;
|
|
164
|
-
|
|
165
132
|
default:
|
|
166
133
|
break;
|
|
167
134
|
}
|
|
168
135
|
} else if (type === 'response') {
|
|
169
136
|
// 响应壳子的回调
|
|
170
137
|
var pending = _this2.getPending(msgId);
|
|
171
|
-
|
|
172
138
|
pending && pending.receiveResponse({
|
|
173
139
|
data: data,
|
|
174
140
|
code: code,
|
|
@@ -177,20 +143,16 @@ var Frame = /*#__PURE__*/(0, _createClass2["default"])(function Frame() {
|
|
|
177
143
|
code != -3 && _this2.deletePending(msgId);
|
|
178
144
|
}
|
|
179
145
|
};
|
|
180
|
-
|
|
181
146
|
this.init = function () {
|
|
182
147
|
window.addEventListener('message', function (msg) {
|
|
183
148
|
(0, _utils.log)('electron res: ', msg);
|
|
184
|
-
|
|
185
149
|
_this2.handleCallback(msg.data || {});
|
|
186
150
|
});
|
|
187
151
|
window.receiveBrowserViewData && window.receiveBrowserViewData(function (e, response) {
|
|
188
152
|
return _this2.handleCallback(response);
|
|
189
153
|
});
|
|
190
154
|
};
|
|
191
|
-
|
|
192
155
|
this.pendingMsgs = {};
|
|
193
156
|
});
|
|
194
157
|
var frame = new Frame();
|
|
195
|
-
var _default = frame;
|
|
196
|
-
exports["default"] = _default;
|
|
158
|
+
var _default = exports["default"] = frame;
|