code refactor

This commit is contained in:
MaysWind
2021-01-05 22:55:34 +08:00
parent fbfba764d4
commit abae1c85e7
16 changed files with 172 additions and 122 deletions
+5
View File
@@ -264,6 +264,10 @@ function clearUserInfoState(context) {
context.commit(CLEAR_USER_INFO);
}
function resetState(context) {
context.commit(RESET_STATE);
}
function currentUserNickname(state) {
const userInfo = state.currentUserInfo || {};
return userInfo.nickname || userInfo.username || null;
@@ -282,6 +286,7 @@ export default {
getCurrentUserProfile,
updateUserProfile,
clearUserInfoState,
resetState,
currentUserNickname,
currentUserDefaultCurrency
}