修复:修复按店铺删除用户残留显示
This commit is contained in:
@@ -971,7 +971,12 @@ const handleModalCancel = () => {
|
||||
|
||||
const handleStatusChange = async (record: any, checked: boolean) => {
|
||||
try {
|
||||
await adminUserApi.updateUserStatus(record.id, checked ? 1 : 0)
|
||||
const success = await adminUserApi.updateUserStatus(record.id, checked ? 1 : 0)
|
||||
if (!success) {
|
||||
message.warning('未找到当前店铺下可更新状态的用户绑定')
|
||||
await fetchUserList()
|
||||
return
|
||||
}
|
||||
record.status = checked ? 1 : 0
|
||||
message.success(`已${checked ? '启用' : '停用'}当前店铺下的用户访问`)
|
||||
} catch (error) {
|
||||
@@ -1002,7 +1007,12 @@ const handleDelete = async (record: any) => {
|
||||
message.warning('管理员账号无法被删除')
|
||||
return
|
||||
}
|
||||
await adminUserApi.deleteUser(record.id)
|
||||
const success = await adminUserApi.deleteUser(record.id)
|
||||
if (!success) {
|
||||
message.warning('未找到当前店铺下可删除的用户绑定')
|
||||
await fetchUserList()
|
||||
return
|
||||
}
|
||||
message.success('已移除当前店铺下的用户绑定')
|
||||
await fetchUserList()
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user