fix: 网络异常提示去掉
This commit is contained in:
parent
22212c39e5
commit
127886d046
@ -1,10 +1,6 @@
|
|||||||
import http from '@ohos.net.http';
|
import http from '@ohos.net.http';
|
||||||
import convertxml from '@ohos.convertxml';
|
import convertxml from '@ohos.convertxml';
|
||||||
import prompt from '@ohos.prompt'
|
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 '@system.prompt';
|
import Prompt from '@system.prompt';
|
||||||
|
|
||||||
|
|
||||||
@ -95,10 +91,10 @@ export default async function tempRequest<T>(req: any): Promise<T> {
|
|||||||
}
|
}
|
||||||
}).catch(Error => {
|
}).catch(Error => {
|
||||||
console.info('test-error0' + url + ' error:resp: ' + JSON.stringify(Error.message))
|
console.info('test-error0' + url + ' error:resp: ' + JSON.stringify(Error.message))
|
||||||
Prompt.showToast({
|
// Prompt.showToast({
|
||||||
message: Error?.message=='Failure when receiving data from the peer'?'网络异常,请重试':Error?.message,
|
// message: Error?.message == 'Failure when receiving data from the peer' ? '网络异常,请重试' : Error?.message,
|
||||||
duration: 5000
|
// duration: 5000
|
||||||
});
|
// });
|
||||||
reject(Error)
|
reject(Error)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -110,10 +106,10 @@ export default async function tempRequest<T>(req: any): Promise<T> {
|
|||||||
code: -1
|
code: -1
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
Prompt.showToast({
|
// Prompt.showToast({
|
||||||
message: e?.message=='Failure when receiving data from the peer'?'网络异常,请重试':e?.message,
|
// message: e?.message=='Failure when receiving data from the peer'?'网络异常,请重试':e?.message,
|
||||||
duration: 5000
|
// duration: 5000
|
||||||
});
|
// });
|
||||||
reject({
|
reject({
|
||||||
code: e.code
|
code: e.code
|
||||||
})
|
})
|
||||||
@ -123,7 +119,6 @@ export default async function tempRequest<T>(req: any): Promise<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//xml格式转JSON
|
//xml格式转JSON
|
||||||
function xmlToJson(result, url) {
|
function xmlToJson(result, url) {
|
||||||
console.log("xmlToJson begin", url);
|
console.log("xmlToJson begin", url);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user