feat: 优化项目目录结构
This commit is contained in:
18
apps/backend/src/oss/oss.controller.ts
Normal file
18
apps/backend/src/oss/oss.controller.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { Controller, Get, Request, UseGuards } from '@nestjs/common';
|
||||
import { OssService } from './oss.service';
|
||||
import { AuthGuard } from '@nestjs/passport';
|
||||
|
||||
@Controller('oss')
|
||||
export class OssController {
|
||||
constructor(private readonly ossService: OssService) {}
|
||||
|
||||
@UseGuards(AuthGuard('jwt'))
|
||||
@Get('sts')
|
||||
async getStsToken(@Request() req) {
|
||||
const { userId } = req.user;
|
||||
return {
|
||||
...(await this.ossService.getStsToken(`${userId}`)),
|
||||
userId,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user