|
|
|
@ -71,11 +71,15 @@ const user = {
|
|
|
|
|
const uuid = userInfo.uuid
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
login(username, password, code, uuid).then(res => {
|
|
|
|
|
setToken(res.data.token)
|
|
|
|
|
setAdminId(res.data.id)
|
|
|
|
|
commit('SET_TOKEN', res.data.token)
|
|
|
|
|
commit('SET_ADMINID', res.data.id)
|
|
|
|
|
resolve()
|
|
|
|
|
if(res.code == 20000){
|
|
|
|
|
setToken(res.data.token)
|
|
|
|
|
setAdminId(res.data.id)
|
|
|
|
|
commit('SET_TOKEN', res.data.token)
|
|
|
|
|
commit('SET_ADMINID', res.data.id)
|
|
|
|
|
resolve()
|
|
|
|
|
}else{
|
|
|
|
|
reject(res.message);
|
|
|
|
|
}
|
|
|
|
|
}).catch(error => {
|
|
|
|
|
reject(error)
|
|
|
|
|
})
|
|
|
|
|