feat 存档
This commit is contained in:
10
config.js
10
config.js
@@ -2,9 +2,13 @@ const config = {
|
|||||||
baseUrl: getBaseUrl(),
|
baseUrl: getBaseUrl(),
|
||||||
api: {
|
api: {
|
||||||
login: '/gw/open/login',
|
login: '/gw/open/login',
|
||||||
getQuestion: '/qgdzs/open/get_question',
|
getQuestion: '/qgdzs/open/random/question',
|
||||||
answerQuestion: '/qgdzs/open/answer_question',
|
answerQuestion: '/qgdzs/open/random/answer',
|
||||||
getAllCategory: '/qgdzs/open/get_all_category'
|
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
|
timeout: 30000
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
"name" : "卷王大乱斗",
|
"name" : "卷王大乱斗",
|
||||||
"appid" : "__UNI__3947B70",
|
"appid" : "__UNI__3947B70",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.0.11",
|
"versionName" : "1.0.12",
|
||||||
"versionCode" : 1011,
|
"versionCode" : 1012,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ export default {
|
|||||||
this.selectedAnswer = answer
|
this.selectedAnswer = answer
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await api.answerQuestion(this.question.sn, answer)
|
const res = await api.answerCategoryQuestion(this.question.sn, answer)
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
this.answered = true
|
this.answered = true
|
||||||
this.correctAnswer = res.data.answer || answer
|
this.correctAnswer = res.data.answer || answer
|
||||||
@@ -153,7 +153,7 @@ export default {
|
|||||||
|
|
||||||
async refreshQuestion() {
|
async refreshQuestion() {
|
||||||
try {
|
try {
|
||||||
const res = await api.getQuestion(this.categorySn)
|
const res = await api.getCategoryQuestion(this.categorySn)
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
if (storage.isQuestionAnswered(res.data.sn)) {
|
if (storage.isQuestionAnswered(res.data.sn)) {
|
||||||
this.refreshQuestion()
|
this.refreshQuestion()
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ export default {
|
|||||||
|
|
||||||
async loadQuestion() {
|
async loadQuestion() {
|
||||||
try {
|
try {
|
||||||
const res = await api.getQuestion()
|
const res = await api.getQuicklyQuestion()
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
this.question = res.data
|
this.question = res.data
|
||||||
this.resetAnswer()
|
this.resetAnswer()
|
||||||
@@ -203,7 +203,7 @@ export default {
|
|||||||
this.totalCount++
|
this.totalCount++
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await api.answerQuestion(this.question.sn, answer)
|
const res = await api.answerQuicklyQuestion(this.question.sn, answer)
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
this.correctAnswer = res.data.answer || answer
|
this.correctAnswer = res.data.answer || answer
|
||||||
|
|
||||||
|
|||||||
37
utils/api.js
37
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() {
|
getAllCategory() {
|
||||||
return request({
|
return request({
|
||||||
url: config.api.getAllCategory,
|
url: config.api.getAllCategory,
|
||||||
|
|||||||
Reference in New Issue
Block a user