修复:全局治理雪花ID精度问题
This commit is contained in:
@@ -403,6 +403,8 @@ import {
|
||||
type UserBalanceHistoryItem,
|
||||
type UserVO
|
||||
} from '@/api/admin'
|
||||
import type { IdType } from '@/utils/id'
|
||||
import { sameId } from '@/utils/id'
|
||||
import { usePermission } from '@/utils/permission'
|
||||
|
||||
const { hasPermission, hasAnyPermission, loadUserPermissions } = usePermission()
|
||||
@@ -939,7 +941,7 @@ const showViewModal = (record: any) => {
|
||||
viewModalVisible.value = true
|
||||
}
|
||||
|
||||
const loadUserAssetData = async (userId: number) => {
|
||||
const loadUserAssetData = async (userId: IdType) => {
|
||||
const [asset, history] = await Promise.all([
|
||||
adminUserApi.getUserAsset(userId),
|
||||
adminUserApi.getUserBalanceHistory(userId)
|
||||
@@ -1080,7 +1082,7 @@ const handleDelete = async (record: any) => {
|
||||
await fetchUserList()
|
||||
return
|
||||
}
|
||||
userList.value = userList.value.filter(user => user.id !== record.id)
|
||||
userList.value = userList.value.filter(user => !sameId(user.id, record.id))
|
||||
pagination.total = Math.max(0, Number(pagination.total || 0) - 1)
|
||||
message.success('已删除用户账号')
|
||||
await fetchUserList()
|
||||
@@ -1102,7 +1104,7 @@ const handleUnbind = async (record: any) => {
|
||||
await fetchUserList()
|
||||
return
|
||||
}
|
||||
userList.value = userList.value.filter(user => user.id !== record.id)
|
||||
userList.value = userList.value.filter(user => !sameId(user.id, record.id))
|
||||
pagination.total = Math.max(0, Number(pagination.total || 0) - 1)
|
||||
if (currentUserType.value === 2 && record.type === 3) {
|
||||
message.success('已解绑当前店铺下的美甲师,并已同步降级为普通用户')
|
||||
@@ -1123,7 +1125,7 @@ const refreshAssetPanel = async () => {
|
||||
assetLoading.value = true
|
||||
try {
|
||||
await loadUserAssetData(assetTargetUser.value.id)
|
||||
const matchedUser = userList.value.find(user => user.id === assetTargetUser.value?.id)
|
||||
const matchedUser = userList.value.find(user => sameId(user.id, assetTargetUser.value?.id))
|
||||
if (matchedUser && assetData.value) {
|
||||
matchedUser.level = assetData.value.vipLevel
|
||||
matchedUser.vipId = assetData.value.vipInfoId
|
||||
|
||||
Reference in New Issue
Block a user