af-mobile-client-vue3 1.3.37 → 1.3.38

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "af-mobile-client-vue3",
3
3
  "type": "module",
4
- "version": "1.3.37",
4
+ "version": "1.3.38",
5
5
  "packageManager": "pnpm@10.13.1",
6
6
  "description": "Vue + Vite component lib",
7
7
  "engines": {
@@ -19,15 +19,20 @@ interface Param {
19
19
  export class mobileUtil {
20
20
  // 执行flutter端函数
21
21
  static execute(locationParam: Param): any {
22
- locationParam.callBackMethodName = `mobile_func_${Math.random().toString(36).substring(7)}`
23
- if (window.__MICRO_APP_ENVIRONMENT__) {
24
- console.warn('Page Load in _MICRO_APP_');
25
- // 微前端应用中需要绑定函数到真实的window中
26
- (window as any).rawWindow[locationParam.callBackMethodName] = locationParam.callbackFunc
22
+ try {
23
+ locationParam.callBackMethodName = `mobile_func_${Math.random().toString(36).substring(7)}`
24
+ if (window.__MICRO_APP_ENVIRONMENT__) {
25
+ console.warn('Page Load in _MICRO_APP_');
26
+ // 微前端应用中需要绑定函数到真实的window
27
+ (window as any).rawWindow[locationParam.callBackMethodName] = locationParam.callbackFunc
28
+ }
29
+ else {
30
+ window[locationParam.callBackMethodName] = locationParam.callbackFunc
31
+ }
32
+ window[locationParam.funcName].postMessage(JSON.stringify(locationParam))
27
33
  }
28
- else {
29
- window[locationParam.callBackMethodName] = locationParam.callbackFunc
34
+ catch (e) {
35
+ locationParam.callbackFunc({ status: 'error', msg: '手机端函数调用失败!!!' })
30
36
  }
31
- window[locationParam.funcName].postMessage(JSON.stringify(locationParam))
32
37
  }
33
38
  }