Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
yangchenggong1_wd
2024-09-26 16:18:09 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
4b1e70e3dfbcd61501c898ded6f622a0e2868c89
4b1e70e3
1 parent
ba0e1612
fix |> 18601 【功能问题】全域异常场景-部分需求未实现
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
6 deletions
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpRequest.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/PageHelper.ets
sight_harmony/features/wdComponent/src/main/ets/viewmodel/PageViewModel.ets
sight_harmony/commons/wdNetwork/src/main/ets/http/HttpRequest.ets
View file @
4b1e70e
...
...
@@ -53,28 +53,36 @@ export class HttpRequest {
static get<T = ResponseDTO<string>>(url: string, headers?: HashMap<string, string>): Promise<T> {
let config: AxiosRequestConfig = {
headers: HttpRequest.buildHeaderWithGlobalHeader(headers)
headers: HttpRequest.buildHeaderWithGlobalHeader(headers),
timeout:10000,
timeoutErrorMessage:"当前无网络,请重试"
}
return service.get(url, config)
}
static post<T = ResponseDTO<string>>(url: string, data?: object, headers?: HashMap<string, string>): Promise<T> {
let config: AxiosRequestConfig = {
headers: HttpRequest.buildHeaderWithGlobalHeader(headers)
headers: HttpRequest.buildHeaderWithGlobalHeader(headers),
timeout:10000,
timeoutErrorMessage:"当前无网络,请重试"
}
return service.post(url, data, config)
}
static put<T = ResponseDTO<string>>(url: string, data?: object, headers?: HashMap<string, string>): Promise<T> {
let config: AxiosRequestConfig = {
headers: HttpRequest.buildHeaderWithGlobalHeader(headers)
headers: HttpRequest.buildHeaderWithGlobalHeader(headers),
timeout:10000,
timeoutErrorMessage:"当前无网络,请重试"
}
return service.put(url, data, config)
}
static delete<T = ResponseDTO<string>>(url: string, headers?: HashMap<string, string>): Promise<T> {
let config: AxiosRequestConfig = {
headers: HttpRequest.buildHeaderWithGlobalHeader(headers)
headers: HttpRequest.buildHeaderWithGlobalHeader(headers),
timeout:10000,
timeoutErrorMessage:"当前无网络,请重试"
}
return service.delete(url, config)
}
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/PageHelper.ets
View file @
4b1e70e
...
...
@@ -154,7 +154,7 @@ export class PageHelper {
}
// Logger.debug(TAG, 'getPageInfo go on')
this.parseGroup(pageModel, cacheIsSame)
}).catch(() => {
}).catch((
err:Error
) => {
this.refreshUIEnd(pageModel, false)
if (this.isPageLoaded(pageModel)) {
return
...
...
sight_harmony/features/wdComponent/src/main/ets/viewmodel/PageViewModel.ets
View file @
4b1e70e
...
...
@@ -15,7 +15,7 @@ import {
} from 'wdBean';
import { CompStyle } from 'wdConstant/Index';
import { CollectionUtils, Logger, ResourcesUtils, StringUtils } from 'wdKit';
import { CollectionUtils, Logger, ResourcesUtils, StringUtils
, ToastUtils
} from 'wdKit';
import { CacheData, ResponseDTO, } from 'wdNetwork';
import { PageUIReqBean } from '../components/page/bean/PageUIReqBean';
import { PageRepository } from '../repository/PageRepository';
...
...
@@ -240,6 +240,9 @@ export class PageViewModel extends BaseViewModel {
}).catch((err: Error) => {
Logger.error(TAG, `getPageInfo then,error.name : ${err.name}, error.message:${err.message}`);
error(err);
if(err.message == "网络出小差了,请检查网络后重试"){
ToastUtils.shortToast(err.message)
}
});
});
}
...
...
Please
register
or
login
to post a comment