fix: 超级管理员和自己不能改自己用户状态
This commit is contained in:
@@ -33,6 +33,7 @@ import useUserStore from '@/store/modules/user';
|
||||
import { DataNode } from 'ant-design-vue/lib/tree';
|
||||
import { RESULT_CODE_SUCCESS } from '@/constants/result-constants';
|
||||
const { getDict } = useDictStore();
|
||||
const userStore = useUserStore();
|
||||
|
||||
/**字典数据 */
|
||||
let dict: {
|
||||
@@ -341,7 +342,7 @@ function fnModalVisibleByVive(userId: string | number) {
|
||||
modalState.from.roleIds = roleIds;
|
||||
modalState.from.postIds = postIds;
|
||||
// 头像解析
|
||||
modalState.from.avatar = useUserStore().fnAvatar(modalState.from.avatar);
|
||||
modalState.from.avatar = userStore.fnAvatar(modalState.from.avatar);
|
||||
modalState.title = '用户信息';
|
||||
modalState.visibleByView = true;
|
||||
} else {
|
||||
@@ -974,8 +975,15 @@ onMounted(() => {
|
||||
{{ record.dept?.deptName }}
|
||||
</template>
|
||||
<template v-if="column.key === 'status'">
|
||||
<DictTag
|
||||
v-if="
|
||||
record.userId === '1' || record.userName === userStore.userName
|
||||
"
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="record.status"
|
||||
/>
|
||||
<a-switch
|
||||
v-if="record.userId !== '1'"
|
||||
v-else
|
||||
v-perms:has="['system:user:edit']"
|
||||
v-model:checked="record.status"
|
||||
checked-value="1"
|
||||
@@ -985,11 +993,6 @@ onMounted(() => {
|
||||
size="small"
|
||||
@change="fnRecordStatus(record)"
|
||||
/>
|
||||
<DictTag
|
||||
v-else
|
||||
:options="dict.sysNormalDisable"
|
||||
:value="record.status"
|
||||
/>
|
||||
</template>
|
||||
<template v-if="column.key === 'userId'">
|
||||
<a-space :size="8" align="center" v-if="record.userId !== '1'">
|
||||
|
||||
Reference in New Issue
Block a user