|
|
@ -4,41 +4,47 @@
|
|
|
|
* @Github:
|
|
|
|
* @Github:
|
|
|
|
* @Date: 2020-01-15 15:44:36
|
|
|
|
* @Date: 2020-01-15 15:44:36
|
|
|
|
* @LastEditors : tangjiang
|
|
|
|
* @LastEditors : tangjiang
|
|
|
|
* @LastEditTime : 2020-01-16 11:20:24
|
|
|
|
* @LastEditTime : 2020-01-17 10:06:45
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
import axios from 'axios';
|
|
|
|
import axios from 'axios';
|
|
|
|
|
|
|
|
|
|
|
|
// 获取代码块
|
|
|
|
// 获取代码块
|
|
|
|
export async function fetchWxCode (identifier, params) {
|
|
|
|
export async function fetchWxCode (identifier, params) {
|
|
|
|
const url = `/tasks/${identifier}/rep_content.json`;
|
|
|
|
const url = `/tasks/${identifier}/rep_content.json`;
|
|
|
|
|
|
|
|
params = Object.assign({}, params, {withCredentials: true});
|
|
|
|
return axios.get(url, {params});
|
|
|
|
return axios.get(url, {params});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 获取测试值
|
|
|
|
// 获取测试值
|
|
|
|
export async function fetchWxCodeTextCase (identifier) {
|
|
|
|
export async function fetchWxCodeTextCase (identifier) {
|
|
|
|
const url = `/tasks/${identifier}.json`;
|
|
|
|
const url = `/tasks/${identifier}.json`;
|
|
|
|
return axios.get(url);
|
|
|
|
const params = Object.assign({}, {withCredentials: true});
|
|
|
|
|
|
|
|
return axios.get(url, {params});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 更新代码块内容
|
|
|
|
// 更新代码块内容
|
|
|
|
export async function fetchUpdateWxCode (identifier, params) {
|
|
|
|
export async function fetchUpdateWxCode (identifier, params) {
|
|
|
|
// /myshixuns/8etu3pilsa/update_file.json
|
|
|
|
// /myshixuns/8etu3pilsa/update_file.json
|
|
|
|
const url = `/myshixuns/${identifier}/update_file.json`;
|
|
|
|
const url = `/myshixuns/${identifier}/update_file.json`;
|
|
|
|
|
|
|
|
params = Object.assign({}, params, {withCredentials: true});
|
|
|
|
return axios.post(url, params);
|
|
|
|
return axios.post(url, params);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 恢复初始化
|
|
|
|
// 恢复初始化
|
|
|
|
export async function fetchRestoreWxCode (identifier, params) {
|
|
|
|
export async function fetchRestoreWxCode (identifier, params) {
|
|
|
|
const url = `/tasks/${identifier}/reset_original_code.json`;
|
|
|
|
const url = `/tasks/${identifier}/reset_original_code.json`;
|
|
|
|
|
|
|
|
params = Object.assign({}, params, {withCredentials: true});
|
|
|
|
return axios.get(url, {params});
|
|
|
|
return axios.get(url, {params});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 评测
|
|
|
|
// 评测
|
|
|
|
export async function fetchWxCodeGameBuild (identifier, params) {
|
|
|
|
export async function fetchWxCodeGameBuild (identifier, params) {
|
|
|
|
const url = `/tasks/${identifier}/game_build.json`;
|
|
|
|
const url = `/tasks/${identifier}/game_build.json`;
|
|
|
|
|
|
|
|
params = Object.assign({}, params, {withCredentials: true});
|
|
|
|
return axios.get(url, {params});
|
|
|
|
return axios.get(url, {params});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
export async function fetchWxCodeGameStatus (identifier) {
|
|
|
|
export async function fetchWxCodeGameStatus (identifier) {
|
|
|
|
const url = `/tasks/${identifier}/game_status.json`;
|
|
|
|
const url = `/tasks/${identifier}/game_status.json`;
|
|
|
|
return axios.get(url);
|
|
|
|
const params = Object.assign({}, {withCredentials: true});
|
|
|
|
|
|
|
|
return axios.get(url, {params});
|
|
|
|
}
|
|
|
|
}
|
|
|
|