|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
* @Github:
|
|
|
|
|
* @Date: 2020-01-15 15:41:10
|
|
|
|
|
* @LastEditors : tangjiang
|
|
|
|
|
* @LastEditTime : 2020-01-17 21:06:46
|
|
|
|
|
* @LastEditTime : 2020-01-17 21:28:23
|
|
|
|
|
*/
|
|
|
|
|
import types from './actionTypes.js';
|
|
|
|
|
import {
|
|
|
|
@ -133,10 +133,12 @@ export const evaluateWxCode = (identifier, path) => {
|
|
|
|
|
// 定时调用 game_status fetchWxCodeGameStatus
|
|
|
|
|
let count = 1;
|
|
|
|
|
const intervalTime = 500;
|
|
|
|
|
let time_out = false;
|
|
|
|
|
function wxCodeGameStatus (intervalTime, finalTime, count, timer) {
|
|
|
|
|
const excuteTime = (count++) * intervalTime; // 当前执行时间
|
|
|
|
|
console.log(finalTime, count, excuteTime);
|
|
|
|
|
fetchWxCodeGameStatus(identifier, {resubmit: _resubmit}).then(r => {
|
|
|
|
|
if ((excuteTime / 1000) > (finalTime + 1)) time_out = true;
|
|
|
|
|
fetchWxCodeGameStatus(identifier, {resubmit: _resubmit, time_out}).then(r => {
|
|
|
|
|
const { status, test_sets = [], gold, experience, next_game, sets_error_count } = r.data;
|
|
|
|
|
if (+status > -1 || ((excuteTime / 1000) > (finalTime + 1))) {
|
|
|
|
|
clearInterval(timer);
|
|
|
|
|