feat: 新增个人身体画像评估与馆主经营助手
把 3 分钟身体状态评估做成独立获客链路,匿名测评后登录认领完整报告,并接入体验预约与今日待办。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Module } from '@nestjs/common'
|
||||
import { Module, forwardRef } from '@nestjs/common'
|
||||
import { PassportModule } from '@nestjs/passport'
|
||||
import { JwtModule } from '@nestjs/jwt'
|
||||
import { ConfigModule, ConfigService } from '@nestjs/config'
|
||||
@@ -10,6 +10,7 @@ import { JwtStrategy } from './jwt.strategy'
|
||||
import { JwtAuthGuard } from './jwt-auth.guard'
|
||||
import { RolesGuard } from './roles.guard'
|
||||
import { InviteModule } from '../invite/invite.module'
|
||||
import { BodyPortraitModule } from '../body-portrait/body-portrait.module'
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
@@ -17,6 +18,7 @@ import { InviteModule } from '../invite/invite.module'
|
||||
InviteModule,
|
||||
ConfigModule,
|
||||
MembershipModule,
|
||||
forwardRef(() => BodyPortraitModule),
|
||||
JwtModule.registerAsync({
|
||||
imports: [ConfigModule],
|
||||
inject: [ConfigService],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Inject, Injectable, UnauthorizedException } from '@nestjs/common'
|
||||
import { Inject, Injectable, Optional, UnauthorizedException, forwardRef } from '@nestjs/common'
|
||||
import { JwtService } from '@nestjs/jwt'
|
||||
import { User } from '@prisma/client'
|
||||
import {
|
||||
@@ -13,6 +13,7 @@ import { ConfigService } from '@nestjs/config'
|
||||
import { PrismaService } from '../prisma/prisma.service'
|
||||
import { WechatService } from './wechat.service'
|
||||
import { InviteService } from '../invite/invite.service'
|
||||
import { BodyPortraitLifecycleService } from '../body-portrait/body-portrait-lifecycle.service'
|
||||
|
||||
export interface LoginResult {
|
||||
token: string
|
||||
@@ -67,6 +68,9 @@ export class AuthService {
|
||||
private readonly inviteService: InviteService,
|
||||
private readonly configService: ConfigService,
|
||||
@Inject(RANDOM_FN_TOKEN) private readonly randomFn: () => number = Math.random,
|
||||
@Optional()
|
||||
@Inject(forwardRef(() => BodyPortraitLifecycleService))
|
||||
private readonly portraitLifecycle?: BodyPortraitLifecycleService,
|
||||
) {}
|
||||
|
||||
private buildSubscriptionTemplateConfig(): SubscriptionMessageTemplateConfig {
|
||||
@@ -179,9 +183,11 @@ export class AuthService {
|
||||
iv,
|
||||
)
|
||||
|
||||
return this.prisma.user.update({
|
||||
const updated = await this.prisma.user.update({
|
||||
where: { id: userId },
|
||||
data: { phone: phoneInfo.phoneNumber },
|
||||
})
|
||||
await this.portraitLifecycle?.onPhoneBound(userId)
|
||||
return updated
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user