From 3e99715eac7400945fc207c2fd447c7badcafd10 Mon Sep 17 00:00:00 2001 From: "DESKTOP-V763RJ7\\Administrator" <835606593@qq.com> Date: Fri, 30 Jan 2026 14:42:24 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E5=AD=98=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.js | 10 +++-- manifest.json | 4 +- pages/category-question/category-question.vue | 4 +- pages/quick/quick.vue | 4 +- utils/api.js | 37 +++++++++++++++++++ 5 files changed, 50 insertions(+), 9 deletions(-) diff --git a/config.js b/config.js index 9594a0c..630c7fe 100644 --- a/config.js +++ b/config.js @@ -2,9 +2,13 @@ const config = { baseUrl: getBaseUrl(), api: { login: '/gw/open/login', - getQuestion: '/qgdzs/open/get_question', - answerQuestion: '/qgdzs/open/answer_question', - getAllCategory: '/qgdzs/open/get_all_category' + getQuestion: '/qgdzs/open/random/question', + answerQuestion: '/qgdzs/open/random/answer', + getAllCategory: '/qgdzs/open/category/get_category', + getCategoryQuestion: '/qgdzs/open/category/question', + answerCategoryQuestion: '/qgdzs/open/category/answer', + getQuicklyQuestion: '/qgdzs/open/quickly/question', + answerQuicklyQuestion: '/qgdzs/open/quickly/answer' }, timeout: 30000 } diff --git a/manifest.json b/manifest.json index 4ac4ada..5537fb4 100644 --- a/manifest.json +++ b/manifest.json @@ -2,8 +2,8 @@ "name" : "卷王大乱斗", "appid" : "__UNI__3947B70", "description" : "", - "versionName" : "1.0.11", - "versionCode" : 1011, + "versionName" : "1.0.12", + "versionCode" : 1012, "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { diff --git a/pages/category-question/category-question.vue b/pages/category-question/category-question.vue index 89afcfb..9b8014c 100644 --- a/pages/category-question/category-question.vue +++ b/pages/category-question/category-question.vue @@ -122,7 +122,7 @@ export default { this.selectedAnswer = answer try { - const res = await api.answerQuestion(this.question.sn, answer) + const res = await api.answerCategoryQuestion(this.question.sn, answer) if (res.data) { this.answered = true this.correctAnswer = res.data.answer || answer @@ -153,7 +153,7 @@ export default { async refreshQuestion() { try { - const res = await api.getQuestion(this.categorySn) + const res = await api.getCategoryQuestion(this.categorySn) if (res.data) { if (storage.isQuestionAnswered(res.data.sn)) { this.refreshQuestion() diff --git a/pages/quick/quick.vue b/pages/quick/quick.vue index 72f972c..fa624bb 100644 --- a/pages/quick/quick.vue +++ b/pages/quick/quick.vue @@ -158,7 +158,7 @@ export default { async loadQuestion() { try { - const res = await api.getQuestion() + const res = await api.getQuicklyQuestion() if (res.data) { this.question = res.data this.resetAnswer() @@ -203,7 +203,7 @@ export default { this.totalCount++ try { - const res = await api.answerQuestion(this.question.sn, answer) + const res = await api.answerQuicklyQuestion(this.question.sn, answer) if (res.data) { this.correctAnswer = res.data.answer || answer diff --git a/utils/api.js b/utils/api.js index 0552dde..e20e95b 100644 --- a/utils/api.js +++ b/utils/api.js @@ -217,6 +217,43 @@ const api = { }) }, + getCategoryQuestion(categorySn) { + return request({ + url: config.api.getCategoryQuestion, + method: 'POST', + data: { category_sn: categorySn } + }) + }, + + answerCategoryQuestion(sn, answer) { + return request({ + url: config.api.answerCategoryQuestion, + method: 'POST', + data: { + sn, + answer + } + }) + }, + + getQuicklyQuestion() { + return request({ + url: config.api.getQuicklyQuestion, + method: 'POST' + }) + }, + + answerQuicklyQuestion(sn, answer) { + return request({ + url: config.api.answerQuicklyQuestion, + method: 'POST', + data: { + sn, + answer + } + }) + }, + getAllCategory() { return request({ url: config.api.getAllCategory,