diff --git a/src/store/modules/user.js b/src/store/modules/user.js index dab05555f..2a033eea6 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -157,6 +157,8 @@ const user = { } else { reject('getInfo: roles must be a non-null array !'); } + const deviceVO = response.data.deviceVO; + commit('SET_NAME', user.name); commit('SET_NICKNAME', user.nickname); commit('SET_ID', user.id); @@ -168,7 +170,9 @@ const user = { commit('SET_COMPANYNAME', user.companyName); commit('SET_COMPANYPROJECTLIST', user.projectCodes); commit('SET_THIRDLOGIN', response.data.thirdLogin); - commit('setDeviceConfig', JSON.parse(response.data.deviceVO.config || '{}')); + if (deviceVO) { + commit('setDeviceConfig', JSON.parse(deviceVO.config || '{}')); + } resolve(user); }).catch(error => { reject(error);