您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 

18 行
571 B

function getCookie(name) {
var value = "; " + document.cookie;
var parts = value.split("; " + name + "=");
if (parts.length == 2) return parts.pop().split(";").shift();
}
fetch('http://api.kfcoding.com/api/practice/trains/competition/begin', {
headers: {
'Content-Type': 'application/json',
Authorization: getCookie('token')
},
method: 'POST',
body: JSON.stringify({repo: 'https://github.com/openx-lab/go-study-guide.git'})
}).then(resp => resp.json())
.then(data => {
if (data.data)
localStorage.setItem('comp_id', data.data.id)
});