From 2514b634e26f956538d052ed6767ebe85e4b78ed Mon Sep 17 00:00:00 2001 From: liangtongchuan Date: Thu, 30 Dec 2021 00:32:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=97=E6=AE=B5=E5=90=8D?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shared/db/User.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared/db/User.ts b/shared/db/User.ts index 0c00b6505..2677646f2 100644 --- a/shared/db/User.ts +++ b/shared/db/User.ts @@ -128,14 +128,14 @@ export default class User extends BaseModel { return user; } - public static async createUserWithChannel(channelId: string, channelType: string, channelInfO: ChannelInfo, token: string, platform: string, pkgName: string, serverType: string, deviceId: string, ip: string = '') { + public static async createUserWithChannel(channelId: string, channelType: string, channelInfo: ChannelInfo, token: string, platform: string, pkgName: string, serverType: string, deviceId: string, ip: string = '') { const curTime: Date = new Date(); const uid = await CounterModel.getNewCounter(COUNTER.UID); const userCode = genCode(8); const doc = new UserModel(); let update = {}; - update = Object.assign(update, doc.toJSON(), { platform, pkgName, serverType, createTime: curTime, uid, userCode, username: `用户${uid}`, token, lastLoginTime: curTime, ip, channelInfO, channelType }); + update = Object.assign(update, doc.toJSON(), { platform, pkgName, serverType, createTime: curTime, uid, userCode, username: `用户${uid}`, token, lastLoginTime: curTime, ip, channelInfo, channelType }); delete update["device"]; const user: UserType = await UserModel.findOneAndUpdate({ channelId }, { $set: update, $addToSet: { device: deviceId } }, { upsert: true, new: true }).lean({ getters: true });