diff --git a/src/store/modules/training.js b/src/store/modules/training.js index c7a8e5b84..7a5a9b232 100644 --- a/src/store/modules/training.js +++ b/src/store/modules/training.js @@ -202,6 +202,7 @@ const training = { state.memberList = memberList; state.memberData = {}; if (memberList && memberList.length) { + let hasUserId = false; memberList.forEach(item => { state.memberData[item.id] = deepAssign({userId: ''}, item); state.memberData[item.id].disabled = userId == item.userId; @@ -209,8 +210,14 @@ const training = { state.roles = item.type; state.roleDeviceCode = item.deviceCode; state.myMemberId = item.id; + hasUserId = true; } }); + if (!hasUserId) { + state.roles = ''; + state.roleDeviceCode = ''; + state.myMemberId = ''; + } } }, setSimulationUserList: (state, simulationUserList) => {