Commit 184c31bb authored by 徐士卿's avatar 徐士卿

Merge branch 'master' of gitlab2.dui88.com:sparkprojects/rb_strongestbrain_250520

parents dbc540ad a0891d6d
......@@ -182,10 +182,22 @@ const API = generateAPI({
rankInfo:`zqdn/rankIndex.do`,
////////////////////////////// Game //////////////////////////////
start:`/zqdn/start.do`,
suggest:`/zqdn/suggest.do`,
middleSubmit:`/zqdn/middleSubmit.do`,
submit:`/zqdn/submit.do`,
start: {
uri: `/zqdn/start.do`,
withToken: true,
},
suggest: {
uri: `/zqdn/suggest.do`,
withToken: true,
},
middleSubmit: {
uri: `/zqdn/middleSubmit.do`,
withToken: true,
},
submit: {
uri: `/zqdn/submit.do`,
withToken: true,
},
})
......
import { makeAutoObservable, } from 'mobx';
import { LevelArr } from "@/pages/GamePage/Level/LevelConfig.ts";
import API from "@/api";
class GameStore {
......@@ -10,12 +11,22 @@ class GameStore {
gameInfo = {
levelIndex: -1,
levelIdxArr: [],
countdownSeconds: 180,
remainTipTimes: 0,
}
async start() {
const { success, data } = await API.start();
if (!success) return false;
this.gameInfo.levelIdxArr = LevelArr.map((_, index) => index);
this.gameInfo.levelIdxArr.sort(() => Math.random() - 0.5);
this.gameInfo.levelIndex = -1;
this.gameInfo.countdownSeconds = data.countdownSeconds;
this.gameInfo.remainTipTimes = data.remainTipTimes
return success;
}
async submit() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment