fix(userManagement): 下发用户改用 userId,修正误用记录主键 id
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
f771bb97d6
commit
92de746f9e
@@ -302,12 +302,12 @@ Page({
|
||||
const userIds = Array.isArray(deviceUserIds) ? deviceUserIds : [deviceUserIds].filter(Boolean)
|
||||
const hasMainUser = userIds.length > 0
|
||||
// 主用户 ID:已有主用户用设备端的,否则用第一个用户作为主用户
|
||||
const mainUserId = hasMainUser ? String(userIds[0]) : pendingUsers[0].id
|
||||
const mainUserId = hasMainUser ? String(userIds[0]) : pendingUsers[0].userId
|
||||
|
||||
const syncDataList: SyncUserData[] = pendingUsers.map((user, index) => ({
|
||||
userID: mainUserId,
|
||||
userName: user.name,
|
||||
memberID: hasMainUser ? user.id : (user.id === pendingUsers[0].id ? '' : user.id),
|
||||
memberID: hasMainUser ? user.userId : (user.userId === pendingUsers[0].userId ? '' : user.userId),
|
||||
age: user.age,
|
||||
gender: user.gender,
|
||||
height: user.height,
|
||||
@@ -348,9 +348,9 @@ Page({
|
||||
_clearAndSync(syncUsers: SyncUser[], reportUsers: SyncUser[] | null) {
|
||||
const mainUser = syncUsers[0]
|
||||
const syncDataList: SyncUserData[] = syncUsers.map((user, index) => ({
|
||||
userID: mainUser.id,
|
||||
userID: mainUser.userId,
|
||||
userName: user.name,
|
||||
memberID: user.id === mainUser.id ? '' : user.id,
|
||||
memberID: user.userId === mainUser.userId ? '' : user.userId,
|
||||
age: user.age,
|
||||
gender: user.gender,
|
||||
height: user.height,
|
||||
|
||||
Reference in New Issue
Block a user