Skip to content

Instantly share code, notes, and snippets.

@nondanee
Last active October 17, 2018 06:07
Show Gist options
  • Save nondanee/110ee2c62a24d04fb81face193250daa to your computer and use it in GitHub Desktop.
Save nondanee/110ee2c62a24d04fb81face193250daa to your computer and use it in GitHub Desktop.
do tutor counselor in UESTC without mianliao app
(function JumpToVote(){
let username = "???"
let password = "???"
let xhr = new XMLHttpRequest()
xhr.onreadystatechange = function(){
if(xhr.readyState == 4 && xhr.status == 200){
let data = JSON.parse(xhr.responseText)
let token = data.response.token
let uid = data.response.uid
window.location.href = `http://dev.tjut.cc:92/?uid=${uid}&token=${token}&source=ml`
}
}
xhr.open('POST','http://prodv1.tjut.cc/api/login/')
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded')
xhr.send(`account=${username}&password=${password}`)
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment