This commit is contained in:
lb
2024-02-29 15:54:49 +08:00
parent a41db38229
commit 838c8d66ad
7 changed files with 56 additions and 51 deletions

View File

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