FC_DAN\c9837 1 сар өмнө
parent
commit
7094683bc6

+ 2 - 0
apps/box-app-api/src/feature/auth/auth.module.ts

@@ -10,6 +10,7 @@ import { CoreModule } from '@box/core/core.module';
 import { JwtStrategy } from './strategies/jwt.strategy';
 import { JwtAuthGuard } from './guards/jwt-auth.guard';
 import { AdModule } from '../ads/ad.module';
+import { SysParamsModule } from '../sys-params/sys-params.module';
 
 @Module({
   imports: [
@@ -17,6 +18,7 @@ import { AdModule } from '../ads/ad.module';
     RabbitmqModule,
     CoreModule,
     AdModule,
+    SysParamsModule,
     PassportModule.register({ defaultStrategy: 'jwt' }),
     JwtModule.registerAsync({
       imports: [ConfigModule],

+ 5 - 4
apps/box-app-api/src/feature/auth/auth.service.ts

@@ -6,6 +6,7 @@ import { RabbitmqPublisherService } from '../../rabbitmq/rabbitmq-publisher.serv
 import { PrismaMongoStatsService } from '../../prisma/prisma-mongo-stats.service';
 import { PrismaMongoService } from '../../prisma/prisma-mongo.service';
 import { AdService } from '../ads/ad.service';
+import { SysParamsService } from '../sys-params/sys-params.service';
 
 type LoginParams = {
   uid: string;
@@ -21,8 +22,7 @@ type LoginResult = {
   uid: string;
   channelId: string;
   startupAds: any | null; // keep as any until you wire your Ad payload DTO
-  cdn_img: string;
-  cdn_video: string;
+  conf: any | null;
 };
 
 @Injectable()
@@ -34,6 +34,7 @@ export class AuthService {
     private readonly prismaMongoStatsService: PrismaMongoStatsService,
     private readonly prismaMongoService: PrismaMongoService, // box-admin
     private readonly adService: AdService,
+    private readonly sysParamsService: SysParamsService,
   ) {}
 
   async login(params: LoginParams): Promise<LoginResult> {
@@ -105,13 +106,13 @@ export class AuthService {
     // 5) startupAds (placeholder: you’ll wire channel-specific ads later)
     // For now return null to keep behaviour deterministic.
     const startupAds = await this.adService.listAdsByType(1, 20);
+    const conf = await this.sysParamsService.getSysCnf();
 
     return {
       uid,
       channelId: finalChannelId,
       startupAds,
-      cdn_img: 'https://vm.rvakc.xyz/res/decode/',
-      cdn_video: 'https://vm.rvakc.xyz/api/web/media/m3u8/',
+      conf,
     };
   }
 

+ 3 - 1
apps/box-app-api/src/feature/video/video.controller.ts

@@ -44,7 +44,9 @@ interface RequestWithUser extends Request {
 @ApiTags('视频')
 @Controller('video')
 export class VideoController {
-  constructor(private readonly videoService: VideoService) {}
+  constructor(private readonly videoService: VideoService
+  ) {}
+  
 
   /**
    * GET /api/v1/video/search