修复Settings.vue中userApi未定义的问题,正确导入setAdmin函数
This commit is contained in:
parent
b3e83f89a6
commit
03a188e348
Binary file not shown.
@ -2618,6 +2618,7 @@ import {
|
||||
getAllUsers,
|
||||
updateUserDepartment,
|
||||
deleteUser,
|
||||
setAdmin,
|
||||
type User
|
||||
} from '@/api/user'
|
||||
import {
|
||||
@ -4494,7 +4495,7 @@ const deleteUserFromCard = async (user: User) => {
|
||||
const toggleUserAdmin = async (user: User) => {
|
||||
try {
|
||||
const newAdminStatus = user.isAdmin === 1 ? 0 : 1
|
||||
await userApi.setAdmin(user.id!, newAdminStatus)
|
||||
await setAdmin(user.id!, newAdminStatus)
|
||||
message.success(newAdminStatus === 1 ? '已设置为管理员' : '已取消管理员身份')
|
||||
await loadDepartmentUsers()
|
||||
} catch (error) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user