This commit is contained in:
wangxiaoxian 2026-03-09 14:51:36 +08:00
parent 3b75720790
commit 75bc71b532
1 changed files with 0 additions and 11 deletions

View File

@ -156,7 +156,6 @@
<script> <script>
import { getUserList, createUser, updateUser, deleteUser, resetUserPassword } from '@/api/user' import { getUserList, createUser, updateUser, deleteUser, resetUserPassword } from '@/api/user'
import { getAllRoles } from '@/api/role' import { getAllRoles } from '@/api/role'
import { getUserInfo } from '@/utils/auth'
import { hasPermission } from '@/utils/permission' import { hasPermission } from '@/utils/permission'
export default { export default {
@ -178,8 +177,6 @@ export default {
dialogTitle: '添加用户', dialogTitle: '添加用户',
isEdit: false, isEdit: false,
submitLoading: false, submitLoading: false,
currentUserId: null,
isAdmin: false,
userForm: { userForm: {
id: null, id: null,
username: '', username: '',
@ -209,18 +206,10 @@ export default {
} }
}, },
mounted() { mounted() {
this.loadUserInfo()
this.fetchRoleList() this.fetchRoleList()
this.fetchUserList() this.fetchUserList()
}, },
methods: { methods: {
loadUserInfo() {
const userInfo = getUserInfo()
if (userInfo) {
this.currentUserId = userInfo.id
this.isAdmin = userInfo.role === 'admin' || (userInfo.role && userInfo.role.code === 'admin')
}
},
hasPermission, hasPermission,
async fetchRoleList() { async fetchRoleList() {