From 4c230f75f0072ea0ba886aa789f67ddbfee4b822 Mon Sep 17 00:00:00 2001 From: lixiao <932184220@qq.com> Date: Thu, 8 May 2025 17:24:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E4=BC=A0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/api/judgeNew.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/entry/src/main/ets/api/judgeNew.ts b/entry/src/main/ets/api/judgeNew.ts index bad95561..b2de1816 100644 --- a/entry/src/main/ets/api/judgeNew.ts +++ b/entry/src/main/ets/api/judgeNew.ts @@ -76,13 +76,24 @@ export default async function writeObjectOutNew(data, filePath): Promise { await systemPasteboard.clear() await systemPasteboard.setData(pasteData) } catch (e) { - console.log("wzj pasteboard error", e,"项目代码:", params.data.param.ksxm) + console.log("wzj pasteboard error", e, "项目代码:", params.data.param.ksxm) } let fn = () => { return new Promise((resolve, reject) => { + let tick = setTimeout(() => { + emitter.emit({ + eventId: 1 + }) + reject({ + code: 1, data: { + code: 2300007 + } + }) + }, 15 * 1000) console.log("wzj process start,项目代码:", params.data.param.ksxm) globalThis.serviceExtProxy.processData("1", (errorCode: number, retVal: string) => { - console.log("lixiao process accept,项目代码:", params.data.param.ksxm," 错误码:", errorCode, JSON.stringify(retVal)) + console.log("lixiao process accept,项目代码:", params.data.param.ksxm, " 错误码:", errorCode, JSON.stringify(retVal)) + clearTimeout(tick) let result = JSON.parse(retVal) if (result.code === 0) { resolve(result.data) @@ -92,7 +103,6 @@ export default async function writeObjectOutNew(data, filePath): Promise { }) reject(result.data) } - // console.log(`js-test index.ets processData, errorCode: ${errorCode}, retVal: ${retVal}`); }); }) }