修改功能

This commit is contained in:
2025-11-03 14:37:07 +08:00
parent 33a33bb7b0
commit 4ba6539850
3 changed files with 33 additions and 9 deletions

View File

@@ -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,