From dfbe89f10b96c769a93451715284d2c0ea0233ed Mon Sep 17 00:00:00 2001 From: zhl Date: Wed, 19 May 2021 10:25:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E6=8C=91=E6=88=98=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E4=B8=8B,=20timeLeft=E8=BF=94=E5=9B=9E=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E5=B1=80=E7=9A=84=E4=BD=BF=E7=94=A8=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/api.md | 2 +- src/api/controllers/exam.controller.ts | 1 + src/services/Wechat.ts | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 src/services/Wechat.ts diff --git a/doc/api.md b/doc/api.md index d6044f5..ed051c1 100644 --- a/doc/api.md +++ b/doc/api.md @@ -278,7 +278,7 @@ "maxCombo": 1, // 当局连续答对的最大数量 "score": 10, // 当前得分 "star": 1, // 当局胜利后获得的星星 - "timeLeft": 1, // 当局剩余时间 + "timeLeft": 1, // 当局使用时间 "gameResult": 0, // 当局的游戏结果, 单人的话和上一层gameResult相同 "timeLast": 1620973155307 //上次回答时间 } diff --git a/src/api/controllers/exam.controller.ts b/src/api/controllers/exam.controller.ts index 2f26fc6..163ccf3 100644 --- a/src/api/controllers/exam.controller.ts +++ b/src/api/controllers/exam.controller.ts @@ -113,6 +113,7 @@ class ExamController extends BaseController { statMap.errorCount++ statMap.comboCount = 0 } + statMap.timeLeft = (statMap.timeLast - history.createdAt.getTime()) / 1000 history.status = 1 let score = result ? calcExamScore(time, statMap.comboCount) : 0 diff --git a/src/services/Wechat.ts b/src/services/Wechat.ts new file mode 100644 index 0000000..ef017dd --- /dev/null +++ b/src/services/Wechat.ts @@ -0,0 +1,5 @@ + +export async function generateQr({appId, appSecret, scene, filePath}) { + +} +