|
@@ -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)
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|