|
@@ -18,10 +18,18 @@ const user = {
|
|
|
}
|
|
|
state[key] = newInfo[key]
|
|
|
})
|
|
|
+ },
|
|
|
+ SYNC_TOKEN: (state, token) => {
|
|
|
+ Vue.set(state, 'token', token)
|
|
|
}
|
|
|
},
|
|
|
|
|
|
actions: {
|
|
|
+ // 同步login-token
|
|
|
+ SyncToken({ commit }, token) {
|
|
|
+ commit('SYNC_TOKEN', token)
|
|
|
+ },
|
|
|
+
|
|
|
// 登录
|
|
|
Login({ dispatch, commit, state }, userInfo) {
|
|
|
const username = userInfo.username.trim()
|