fix: 网络异常提示去掉

This commit is contained in:
wangzhongjie 2025-03-31 16:54:25 +08:00 committed by lixiao
parent 22212c39e5
commit 127886d046

View File

@ -1,10 +1,6 @@
import http from '@ohos.net.http';
import convertxml from '@ohos.convertxml';
import prompt from '@ohos.prompt'
import { sendGreen } from '../../pages/judgeSDK/utils/judgeCommon';
import { GlobalConfig } from '../../config/index'
import FileUtil from '../../common/utils/File';
import { dateFormat } from '../utils/tools'
import prompt from '@ohos.prompt';
import Prompt from '@system.prompt';
@ -95,10 +91,10 @@ export default async function tempRequest<T>(req: any): Promise<T> {
}
}).catch(Error => {
console.info('test-error0' + url + ' error:resp: ' + JSON.stringify(Error.message))
Prompt.showToast({
message: Error?.message=='Failure when receiving data from the peer'?'网络异常,请重试':Error?.message,
duration: 5000
});
// Prompt.showToast({
// message: Error?.message == 'Failure when receiving data from the peer' ? '网络异常,请重试' : Error?.message,
// duration: 5000
// });
reject(Error)
})
@ -110,10 +106,10 @@ export default async function tempRequest<T>(req: any): Promise<T> {
code: -1
})
}
Prompt.showToast({
message: e?.message=='Failure when receiving data from the peer'?'网络异常,请重试':e?.message,
duration: 5000
});
// Prompt.showToast({
// message: e?.message=='Failure when receiving data from the peer'?'网络异常,请重试':e?.message,
// duration: 5000
// });
reject({
code: e.code
})
@ -123,7 +119,6 @@ export default async function tempRequest<T>(req: any): Promise<T> {
}
//xml格式转JSON
function xmlToJson(result, url) {
console.log("xmlToJson begin", url);