1
This commit is contained in:
@@ -87,6 +87,7 @@ const user = {
|
||||
// 获取用户信息
|
||||
GetInfo({ commit, state }) {
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log('GetInfo')
|
||||
getInfo().then(res => {
|
||||
// 没有 data 数据,赋予个默认值
|
||||
if (!res) {
|
||||
@@ -96,7 +97,7 @@ const user = {
|
||||
user: {
|
||||
id: '',
|
||||
avatar: '',
|
||||
userName: '',
|
||||
username: '',
|
||||
nickname: ''
|
||||
}
|
||||
}
|
||||
@@ -113,7 +114,7 @@ const user = {
|
||||
commit('SET_ROLES', ['ROLE_DEFAULT'])
|
||||
}
|
||||
commit('SET_ID', user.id)
|
||||
commit('SET_NAME', user.userName)
|
||||
// commit('SET_NAME', user.username) //无效调用,接口未提供username值
|
||||
commit('SET_NICKNAME', user.nickname)
|
||||
commit('SET_AVATAR', avatar)
|
||||
resolve(res)
|
||||
|
||||
Reference in New Issue
Block a user