feat(users): 更新用户最后登录时间记录功能

This commit is contained in:
richarjiang
2025-11-20 19:04:38 +08:00
parent afe6ae1c6a
commit 75fbea2c90

View File

@@ -108,6 +108,10 @@ export class UsersService {
}; };
} }
// 更新用户最后登录时间
existingUser.lastLogin = new Date();
await existingUser.save();
const [profile] = await this.userProfileModel.findOrCreate({ const [profile] = await this.userProfileModel.findOrCreate({
where: { userId: existingUser.id }, where: { userId: existingUser.id },
defaults: { userId: existingUser.id }, defaults: { userId: existingUser.id },