diff --git a/src/components/dialog/UserAddEditDialog.vue b/src/components/dialog/UserAddEditDialog.vue index f2ad9d11..c0ec2e1b 100644 --- a/src/components/dialog/UserAddEditDialog.vue +++ b/src/components/dialog/UserAddEditDialog.vue @@ -22,9 +22,12 @@ const props = defineProps({ oper: String, }) -// 当前用户名称 +// 当前登录用户名称 const currentUser = store.state.auth.userName +// 用户名 +const userName = ref('') + // 当前头像缓存 const nowAvatar = ref(avatar1) @@ -93,6 +96,7 @@ async function fetchUserInfo() { if (userForm.value) { userForm.value.avatar = userForm.value.avatar || avatar1 nowAvatar.value = userForm.value.avatar + userName.value = userForm.value.name } } catch (error) { console.error(error) @@ -170,7 +174,7 @@ const canControl = computed(() => { return true } else { // 调用isCurrentUser函数判断是否为当前用户 - return isCurrentUser.value + return !(isCurrentUser.value) } }) @@ -194,7 +198,7 @@ watch(() => store.state.auth.avatar, () => {