Skip to content

Commit

Permalink
feat: 适配可选答案
Browse files Browse the repository at this point in the history
  • Loading branch information
Ray93 committed Aug 1, 2024
1 parent 0ced497 commit 169493f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ async function getQuestionByDay(date: string) {
}

async function commitAnswer(answerParam: AnswerParam) {
if (answerParam.questionAnswer.some((answer) => answer.includes("//"))) {
answerParam.questionAnswer = answerParam.questionAnswer.map((answer) =>
answer.includes("//") ? answer.split("//")[0] : answer
);
}

const data = await customfetch<any>(`https://www.questiontest.cn:5988/clientapi/dailyQuestions/commitAnswer`, {
method: "POST",
headers: { Authorization: globalThis.authToken, "Content-Type": "application/json" },
Expand Down

0 comments on commit 169493f

Please sign in to comment.