修改功能
This commit is contained in:
@@ -88,6 +88,26 @@ const user = {
|
||||
},
|
||||
|
||||
actions: {
|
||||
// 登录
|
||||
LoginByUserInfo({
|
||||
commit,
|
||||
// state
|
||||
}, userInfo) {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
// const info = JSON.parse(JSON.stringify(userInfo))
|
||||
// info.password = '04' + sm2.doEncrypt(info.password, state.publicKey, 0)
|
||||
// info.username = '04' + sm2.doEncrypt(info.username, state.publicKey, 0)
|
||||
login(userInfo).then(res => {
|
||||
console.log('登录接口返回:', res);
|
||||
setToken(res.data.token)
|
||||
commit('SET_TOKEN', res.data.token)
|
||||
resolve(res)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
})
|
||||
})
|
||||
},
|
||||
// 登录
|
||||
Login({
|
||||
commit,
|
||||
|
||||
Reference in New Issue
Block a user