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 });