diff --git a/entry/src/main/ets/api/judge.ts b/entry/src/main/ets/api/judge.ts index 0581b0c3..2605219d 100644 --- a/entry/src/main/ets/api/judge.ts +++ b/entry/src/main/ets/api/judge.ts @@ -109,12 +109,6 @@ export async function writeObjectOut(params, filePath?: string): Promise { await fileUtil.initFolder(filePath); fileUtil.editFile(`${filePath}/wuxi_exam_data.txt`, JSON.stringify(temp) + `\n`); } - // const {code} = temp; - // if(code == '2300007' || code == '2300028'){ - // return await writeObjectOut(params,filePath) - // }else{ - // return temp - // } return temp } diff --git a/entry/src/main/ets/common/utils/TcpClient.ts b/entry/src/main/ets/common/utils/TcpClient.ts index 942a9b83..2faec74d 100644 --- a/entry/src/main/ets/common/utils/TcpClient.ts +++ b/entry/src/main/ets/common/utils/TcpClient.ts @@ -17,7 +17,7 @@ export default class TcpClient { //重连次数 private folderPath - private tcp: any = null + private tcp: socket.TCPSocket = null constructor(tcplocalIp: string, tcplocalIpPort: string, tcpOppositeIp: string, tcpOppositePort: string) { this.localIp = tcplocalIp @@ -65,7 +65,7 @@ export default class TcpClient { this.tcp.connect({ address: { address: this.oppositeIp, port: Number(this.oppositeIpPort), family: 1 - }, timeout: 6000 + }, timeout: 1000 * 15 }).then(() => { this.tcp.setExtraOptions({ keepAlive: true, @@ -148,7 +148,7 @@ export default class TcpClient { offTcp(callback) { console.log(TAG, 'tcpofff') - this.tcp.off('testTagofmessg', callback); + this.tcp.off('message', callback); } closeTcp(callback) { diff --git a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets index a1b2d1c7..3d430815 100644 --- a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets +++ b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets @@ -342,9 +342,6 @@ export default struct SignDisplayCom { } async aboutToAppear() { - // const fileUtil = new FileUtil(globalThis.context) - // const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/ipConfig.txt') - // this.udplocalIp=JSON.parse(data)?.udplocalIp||'192.168.7.170' this.ratio = this.ratio * (this.scaleNum || 1); const {showBack,getSignal} = this diff --git a/entry/src/main/ets/pages/judgeSDK/judge.ts b/entry/src/main/ets/pages/judgeSDK/judge.ts index 6fd27706..c3862001 100644 --- a/entry/src/main/ets/pages/judgeSDK/judge.ts +++ b/entry/src/main/ets/pages/judgeSDK/judge.ts @@ -607,7 +607,7 @@ export default class Judge { const temp = await writeObjectOut(data, filePath); console.log("wzj", JSON.stringify(temp)) //断网&网络超时次数计算 - if (temp.code == 2300007 || temp.code == 2300028) { + if (temp.code != 1) { this.disConnectNum += 1; if (this.disConnectNum < 5) { return await this.sendWriteObjectOut(data, filePath)