一、超管端设计优化 - 文档管理SOP体系建立,docs目录重组 - 统一用户管理:跨租户全局视角,合并用户管理+公众用户 - 活动监管全模块重构:全部活动(统计卡片+阶段筛选+SuperDetail详情页)、报名数据/作品数据/评审进度(两层合一扁平列表)、成果发布(去Tab+统计+隐藏写操作) - 菜单精简:移除评委管理/评审规则/通知管理 - Bug修复:租户编辑丢失隐藏菜单、pageSize限制、主色统一 二、UGC绘本创作社区P0 - 数据库:10张新表(user_works/user_work_pages/work_tags等) - 子女账号独立化:Child升级为独立User,家长切换+独立登录 - 用户作品库:CRUD+发布审核,8个API - AI创作流程:提交→生成→保存到作品库,4个API - 作品广场:首页改造为推荐流,标签+搜索+排序 - 内容审核(超管端):作品审核+作品管理+标签管理 - 活动联动:WorkSelector作品选择器 - 布局改造:底部5Tab(发现/创作/活动/作品库/我的) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
42 lines
1.0 KiB
TypeScript
42 lines
1.0 KiB
TypeScript
import {
|
|
Controller,
|
|
Post,
|
|
Get,
|
|
Body,
|
|
UseGuards,
|
|
Request,
|
|
} from '@nestjs/common';
|
|
import { AuthGuard } from '@nestjs/passport';
|
|
import { AuthService } from './auth.service';
|
|
import { LoginDto } from './dto/login.dto';
|
|
import { Public } from './decorators/public.decorator';
|
|
|
|
@Controller('auth')
|
|
export class AuthController {
|
|
constructor(private authService: AuthService) {}
|
|
|
|
@Public()
|
|
@UseGuards(AuthGuard('local'))
|
|
@Post('login')
|
|
async login(@Body() loginDto: LoginDto, @Request() req) {
|
|
// 从请求头或请求体获取租户ID
|
|
const tenantId = req.headers['x-tenant-id']
|
|
? parseInt(req.headers['x-tenant-id'], 10)
|
|
: req.user?.tenantId;
|
|
|
|
return this.authService.login(req.user, tenantId);
|
|
}
|
|
|
|
@UseGuards(AuthGuard('jwt'))
|
|
@Get('user-info')
|
|
async getUserInfo(@Request() req) {
|
|
return this.authService.getUserInfo(req.user.userId);
|
|
}
|
|
|
|
@UseGuards(AuthGuard('jwt'))
|
|
@Post('logout')
|
|
async logout() {
|
|
return { message: '登出成功' };
|
|
}
|
|
}
|