1.优化补传错误码处理

2.去掉满分学习灯光模拟
This commit is contained in:
lixiao 2025-05-21 15:23:49 +08:00
parent 9081212995
commit 86fe62c744
4 changed files with 10 additions and 8 deletions

View File

@ -20,7 +20,7 @@ export async function download() {
interface WR {
message?: string
code?: number
code?: number |string
keystr?: string
}

View File

@ -416,10 +416,6 @@ struct Index {
let data = decodeURI(systemParm.txt1)?.split("^")
allItems = data[0]?.split(",").filter(item => item !== "") || []
}
// 满分学习单独做灯光判断
if (this.mode === 5) {
this.mockLight = (allItems.length === 0) || allItems.includes(41 + '')
}
})
console.log("lixiao mockLight", JSON.stringify(allItems), this.mockLight)
systemParms.forEach((systemParm) => {

View File

@ -58,6 +58,14 @@ import promptAction from '@ohos.promptAction';
const judgeTag = 'SURENJUN_JUDGE'
function ifNeedRetry(code: number | string): boolean {
let arr = ["B210010", "B210023", "B210024", "B210031", "B210033", "B210034", "B210041"]
if (!arr.includes(code + "") && code != 1) {
return true
}
return false
}
export default class Judge {
// 过程照片拍照
getPhoto = async (empty?: boolean) => {
@ -605,15 +613,13 @@ export default class Judge {
const temp = await writeObjectOut(data, filePath);
console.log("wzj", JSON.stringify(temp))
//断网&网络超时次数计算
if (temp.code != 1) {
if (ifNeedRetry(temp.code)) {
this.disConnectNum += 1;
if (this.disConnectNum < 5) {
return await this.sendWriteObjectOut(data, filePath)
}
}
if (this.disConnectNum >= 5) {
console.info('surenjun', '123')
this.judgeUI.errorMsg = '当前的考试过程信息网络传输异常,程序点击确认将重启!';
this.judgeUI.disConnectErrorOpen = true
}