|
@@ -19,6 +19,8 @@ const user = {
|
|
|
userId: getUid(),
|
|
|
// 用户名
|
|
|
userName: null,
|
|
|
+ // 最后登陆时间
|
|
|
+ lastLoginTime: null,
|
|
|
// 验证码
|
|
|
codeUrl: null,
|
|
|
// 验证码登录参数
|
|
@@ -37,6 +39,9 @@ const user = {
|
|
|
SET_USER_NAME: (state, value) => {
|
|
|
state.userName = value
|
|
|
},
|
|
|
+ SET_LAST_LOGINTIME: (state, value) => {
|
|
|
+ state.lastLoginTime = value
|
|
|
+ },
|
|
|
SET_CODE_IMG: (state, value) => {
|
|
|
state.codeUrl = 'data:image/gif;base64,' + value
|
|
|
},
|
|
@@ -104,13 +109,15 @@ const user = {
|
|
|
const token = res.data.data.token
|
|
|
const {
|
|
|
userId,
|
|
|
- userName
|
|
|
+ userName,
|
|
|
+ lastLoginTime
|
|
|
} = res.data.data.user
|
|
|
commit('SET_TOKEN', token)
|
|
|
setToken(token)
|
|
|
commit('SET_USER_ID', userId)
|
|
|
setUid(userId)
|
|
|
commit('SET_USER_NAME', userName)
|
|
|
+ commit('SET_LAST_LOGINTIME', lastLoginTime)
|
|
|
}
|
|
|
resolve(res)
|
|
|
}).catch(err => {
|
|
@@ -150,4 +157,4 @@ export default {
|
|
|
state,
|
|
|
mutations,
|
|
|
actions
|
|
|
-}
|
|
|
+}
|