From 3a7d2b4605fabf0b11a996e09a19786c4cbf1fec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E5=8B=A4=E6=B0=91?= Date: Tue, 12 Nov 2024 17:12:11 +0800 Subject: [PATCH] =?UTF-8?q?feat(gx):=20=E6=B7=BB=E5=8A=A0=E5=86=A0?= =?UTF-8?q?=E6=96=B0=E7=94=A8=E6=88=B7=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 GXHomeView 组件,实现冠新首页功能 - 添加 GXAppPermissions组件,用于展示业务权限 - 在 AccountManager 中增加 refresh 方法,用于刷新用户信息 - 在 HttpHelper 中添加 clearHttp 和 cancel 方法,用于清理 HTTP 请求 - 更新 LoginView、RegisterView 和 VerificationView,集成冠新用户相关逻辑- 调整 HomeSwiperView,支持冠新首页轮播图显示 --- BuildProfile.ets | 4 ++-- src/main/ets/http/HttpHelper.ets | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/BuildProfile.ets b/BuildProfile.ets index 155b7b3..9ae474e 100644 --- a/BuildProfile.ets +++ b/BuildProfile.ets @@ -2,8 +2,8 @@ * Use these variables when you tailor your ArkTS code. They must be of the const type. */ export const HAR_VERSION = '1.0.5'; -export const BUILD_MODE_NAME = 'release'; -export const DEBUG = false; +export const BUILD_MODE_NAME = 'debug'; +export const DEBUG = true; export const TARGET_NAME = 'default'; /** diff --git a/src/main/ets/http/HttpHelper.ets b/src/main/ets/http/HttpHelper.ets index 65d648c..9a2c366 100644 --- a/src/main/ets/http/HttpHelper.ets +++ b/src/main/ets/http/HttpHelper.ets @@ -296,4 +296,21 @@ export class HttpHelper { }); } + + clearHttp() { + for (let handler of this.httpHandlerList.keys()) { + this.cancel(handler) + } + + } + + cancel(apiNo: string) { + if (this.httpHandlerList.hasKey(apiNo)) { + this.httpHandlerList.get(apiNo).destroy() + this.httpHandlerList.remove(apiNo) + SZYXLocalStorageHelper.storage.setOrCreate(SZYXLocalStorageKeys.HttpHandlerList, this.httpHandlerList) + SZYXLocalStorageHelper.storage.setOrCreate(SZYXLocalStorageKeys.HttpHandlerListLength, + this.httpHandlerList.length) + } + } } \ No newline at end of file