|
|
@ -1,5 +1,5 @@ |
|
|
|
/* |
|
|
|
/* |
|
|
|
* @Author: your name |
|
|
|
* @Author: Yujialong |
|
|
|
* @Date: 2021-11-03 14:33:21 |
|
|
|
* @Date: 2021-11-03 14:33:21 |
|
|
|
* @LastEditTime: 2021-11-08 19:20:52 |
|
|
|
* @LastEditTime: 2021-11-08 19:20:52 |
|
|
|
* @LastEditors: Please set LastEditors |
|
|
|
* @LastEditors: Please set LastEditors |
|
|
@ -20,6 +20,7 @@ export default { |
|
|
|
state: { |
|
|
|
state: { |
|
|
|
avatar: 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png', |
|
|
|
avatar: 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png', |
|
|
|
schoolId: '', |
|
|
|
schoolId: '', |
|
|
|
|
|
|
|
userName: '', |
|
|
|
isManager: false, |
|
|
|
isManager: false, |
|
|
|
isCustomer: false |
|
|
|
isCustomer: false |
|
|
|
}, |
|
|
|
}, |
|
|
@ -27,6 +28,7 @@ export default { |
|
|
|
SET_INFO: (state, info) => { |
|
|
|
SET_INFO: (state, info) => { |
|
|
|
if(info.avatar) state.avatar = info.avatar |
|
|
|
if(info.avatar) state.avatar = info.avatar |
|
|
|
if(info.schoolId) state.schoolId = info.schoolId |
|
|
|
if(info.schoolId) state.schoolId = info.schoolId |
|
|
|
|
|
|
|
if(info.userName) state.userName = info.userName |
|
|
|
}, |
|
|
|
}, |
|
|
|
SET_AVATAR: (state, avatar) => { |
|
|
|
SET_AVATAR: (state, avatar) => { |
|
|
|
state.avatar = avatar |
|
|
|
state.avatar = avatar |
|
|
@ -56,6 +58,10 @@ export default { |
|
|
|
util.successMsg('登录成功') |
|
|
|
util.successMsg('登录成功') |
|
|
|
get(api.isClient).then(res => { |
|
|
|
get(api.isClient).then(res => { |
|
|
|
commit('SET_CUSTOMER',res.customer) |
|
|
|
commit('SET_CUSTOMER',res.customer) |
|
|
|
|
|
|
|
const userName = res.customerName |
|
|
|
|
|
|
|
userName && commit('SET_INFO', { |
|
|
|
|
|
|
|
userName |
|
|
|
|
|
|
|
}) |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
post(api.getSchoolIdByToken).then(res => { |
|
|
|
post(api.getSchoolIdByToken).then(res => { |
|
|
|
commit('SET_INFO',res) |
|
|
|
commit('SET_INFO',res) |
|
|
|