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