|
|
@@ -140,10 +140,10 @@ import { ref, computed, watch, onMounted, onBeforeUnmount, nextTick } from "vue"
|
|
|
import { useRoute, useRouter } from "vue-router"
|
|
|
import { useStore } from "vuex"
|
|
|
import dayjs from 'dayjs'
|
|
|
-import { shuffle } from 'lodash'
|
|
|
import { addScore, getScore, getExamQuestionList, notifyQuit } from '@/api.js'
|
|
|
import GameRule from '@/components/GameRule.vue'
|
|
|
import NotifyComp from '@/components/NotifyComp.vue'
|
|
|
+import { Base64 } from "js-base64"
|
|
|
|
|
|
const route = useRoute()
|
|
|
const router = useRouter()
|
|
|
@@ -157,10 +157,24 @@ const {
|
|
|
const isShowRule = ref(false)
|
|
|
|
|
|
const isShowLoading = ref(true)
|
|
|
+
|
|
|
getExamQuestionList().then((res) => {
|
|
|
questionList.value = res.map((questionItem) => {
|
|
|
const optionsAndAnswer = JSON.parse(questionItem.answer)
|
|
|
- console.log(optionsAndAnswer)
|
|
|
+
|
|
|
+ // 对正确答案解密
|
|
|
+ const decodeStr = (str) => {
|
|
|
+ const NUM = 2
|
|
|
+ const str1 = str.substring(8)
|
|
|
+ const str2 = str1.substring(0, str1.length - 8)
|
|
|
+ const front = str2.slice(-NUM)
|
|
|
+ const end = str2.substring(0, str2.length - 8 - NUM)
|
|
|
+ return front + end
|
|
|
+ }
|
|
|
+ optionsAndAnswer.correct = Base64.decode(decodeStr(optionsAndAnswer.correct))
|
|
|
+
|
|
|
+ // console.log(optionsAndAnswer)
|
|
|
+
|
|
|
const ret = {
|
|
|
question: questionItem.question,
|
|
|
answerOptions: optionsAndAnswer.answer.map((answerItem) => {
|