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