1
0

7 Commity a04f96c171 ... ee6ab8963a

Autor SHA1 Správa Dátum
  徐勤民 ee6ab8963a fix(core): 修复窗口管理和证书签名功能中的异常处理 1 týždeň pred
  徐勤民 e684edb25a refactor(app): 更新应用配置和依赖管理 1 týždeň pred
  徐勤民 6cc43ce608 refactor(miniapp): 重构二维码处理和授权签名功能 2 týždňov pred
  徐勤民 c8b9f3ea16 fix(env): 修复多域名环境配置和用户ID处理逻辑 3 týždňov pred
  徐勤民 c53e2555c3 chore(build): 更新构建配置为发布模式 1 mesiac pred
  徐勤民 76da5c673e feat(miniapp): 添加 Sentry 日志记录功能并优化环境切换逻辑 1 mesiac pred
  徐勤民 d42309572f chore(build): 更新构建配置为发布模式并移除调试日志 1 mesiac pred

+ 2 - 2
src/main/ets/http/HttpHelper.ets

@@ -88,8 +88,8 @@ export class HttpHelper {
 
       httpRequest.request(HttpHelperX.getUrl(params.url, params.query), {
         method: http.RequestMethod.POST,
-        connectTimeout: 20000,
-        readTimeout: 20000,
+        connectTimeout: 60000,
+        readTimeout: 60000,
         header: header,
         extraData: params.data,
         usingCache: false,

+ 42 - 19
src/main/ets/utils/WindowHelper.ets

@@ -64,8 +64,12 @@ export class WindowHelper {
    */
   static async close(): Promise<void> {
     if (WindowHelper.cacheWindow) {
-      await WindowHelper.cacheWindow.destroyWindow();
-      WindowHelper.cacheWindow = null
+      try {
+        await WindowHelper.cacheWindow.destroyWindow();
+      } catch (error) {
+      } finally {
+        WindowHelper.cacheWindow = null
+      }
     }
   }
 
@@ -81,16 +85,21 @@ export class WindowHelper {
   public static set windowClass(value: window.Window | undefined) {
     WindowHelper._windowClass = value;
     if (value) {
-      GlobalContext.setUiContext(value.getUIContext())
-    }
-    if (WindowHelper._windowClass) {
-      let avoidArea = WindowHelper._windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR);
-      WindowHelper._bottomRectHeight = px2vp(avoidArea.bottomRect.height)
-      let avoidArea2 = WindowHelper._windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_CUTOUT);
-      WindowHelper._topRectHeight = px2vp(avoidArea2.topRect.height)
-      let avoidArea3 = WindowHelper._windowClass.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM);
-      const a = px2vp(avoidArea3.topRect.height)
-      WindowHelper._topRectHeight = a > WindowHelper._topRectHeight ? a : WindowHelper._topRectHeight
+      try {
+        const uc = value.getUIContext()
+        GlobalContext.setUiContext(uc)
+        try {
+          let avoidArea = value.getWindowAvoidArea(window.AvoidAreaType.TYPE_NAVIGATION_INDICATOR);
+          WindowHelper._bottomRectHeight = uc.px2vp(avoidArea.bottomRect.height)
+          let avoidArea2 = value.getWindowAvoidArea(window.AvoidAreaType.TYPE_CUTOUT);
+          WindowHelper._topRectHeight = uc.px2vp(avoidArea2.topRect.height)
+          let avoidArea3 = value.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM);
+          const a = uc.px2vp(avoidArea3.topRect.height)
+          WindowHelper._topRectHeight = a > WindowHelper._topRectHeight ? a : WindowHelper._topRectHeight
+        } catch (error) {
+        }
+      } catch (error) {
+      }
     }
   }
 
@@ -119,11 +128,19 @@ export class WindowHelper {
   }
 
   public static get windowsWidth() {
-    return px2vp(display.getDefaultDisplaySync().width)
+    try {
+      return GlobalContext.getUiContext()?.px2vp(display.getDefaultDisplaySync().width)??0
+    } catch (error) {
+      return 0
+    }
   }
 
   public static get windowsHeight() {
-    return px2vp(display.getDefaultDisplaySync().height)
+    try {
+      return GlobalContext.getUiContext()?.px2vp(display.getDefaultDisplaySync().height)??0
+    } catch (error) {
+      return 0
+    }
   }
 
   /**
@@ -133,7 +150,8 @@ export class WindowHelper {
   static setWindowLayoutFullScreen(isLayoutFullScreen: boolean) {
     if (WindowHelper._windowClass) {
       WindowHelper._isFullScreen = isLayoutFullScreen
-      WindowHelper._windowClass.setWindowLayoutFullScreen(isLayoutFullScreen);
+      WindowHelper._windowClass.setWindowLayoutFullScreen(isLayoutFullScreen).catch(() => {
+      });
     }
   }
 
@@ -142,8 +160,10 @@ export class WindowHelper {
    */
   static hideStatusBar() {
     if (WindowHelper._windowClass) {
-      WindowHelper._windowClass.setSpecificSystemBarEnabled('status', false);
-      WindowHelper._windowClass.setSpecificSystemBarEnabled('navigationIndicator', false);
+      WindowHelper._windowClass.setSpecificSystemBarEnabled('status', false).catch(() => {
+      });
+      WindowHelper._windowClass.setSpecificSystemBarEnabled('navigationIndicator', false).catch(() => {
+      });
     }
   }
 
@@ -152,8 +172,10 @@ export class WindowHelper {
    */
   static showStatusBar() {
     if (WindowHelper._windowClass) {
-      WindowHelper._windowClass.setSpecificSystemBarEnabled('status', true);
-      WindowHelper._windowClass.setSpecificSystemBarEnabled('navigationIndicator', true);
+      WindowHelper._windowClass.setSpecificSystemBarEnabled('status', true).catch(() => {
+      });
+      WindowHelper._windowClass.setSpecificSystemBarEnabled('navigationIndicator', true).catch(() => {
+      });
     }
   }
 
@@ -166,6 +188,7 @@ export class WindowHelper {
     if (WindowHelper._windowClass) {
       WindowHelper._windowClass.setWindowSystemBarProperties({
         statusBarContentColor: color,
+      }).catch(() => {
       })
     }
   }