修复迁移后错误

This commit is contained in:
万物街
2025-09-11 22:06:19 +08:00
parent 7a20a0c50a
commit 6a3b302e69
193 changed files with 11792 additions and 1268 deletions

View File

@@ -0,0 +1,70 @@
import {
Controller,
Get,
Post,
Body,
Query,
UseGuards,
} from '@nestjs/common';
import { Public } from '../../../auth/decorators/public.decorator';
import { LoginConfigApiService } from '../../services/api/LoginConfigApiService';
@Controller('api/login/config')
export class LoginConfigApiController {
constructor(private readonly loginConfigApiService: LoginConfigApiService) {}
/**
* 获取登录配置
*/
@Get('info')
@Public()
async getInfo(@Query() query: any) {
return this.loginConfigApiService.getInfo(query);
}
/**
* 获取登录方式
*/
@Get('methods')
@Public()
async getMethods(@Query() query: any) {
return this.loginConfigApiService.getMethods(query);
}
/**
* 获取验证码配置
*/
@Get('captcha')
@Public()
async getCaptchaConfig(@Query() query: any) {
return this.loginConfigApiService.getCaptchaConfig(query);
}
/**
* 获取第三方登录配置
*/
@Get('third-party')
@Public()
async getThirdPartyConfig(@Query() query: any) {
return this.loginConfigApiService.getThirdPartyConfig(query);
}
/**
* 获取注册配置
*/
@Get('register')
@Public()
async getRegisterConfig(@Query() query: any) {
return this.loginConfigApiService.getRegisterConfig(query);
}
/**
* 获取忘记密码配置
*/
@Get('forgot-password')
@Public()
async getForgotPasswordConfig(@Query() query: any) {
return this.loginConfigApiService.getForgotPasswordConfig(query);
}
}

View File

@@ -0,0 +1,105 @@
import {
Controller,
Post,
Body,
Query,
UseGuards,
} from '@nestjs/common';
import { Public } from '../../../auth/decorators/public.decorator';
import { RegisterApiService } from '../../services/api/RegisterApiService';
@Controller('api/login/register')
export class RegisterApiController {
constructor(private readonly registerApiService: RegisterApiService) {}
/**
* 用户注册
*/
@Post('user')
@Public()
async userRegister(@Body() data: {
username: string;
password: string;
confirm_password: string;
mobile?: string;
email?: string;
captcha?: string;
invite_code?: string;
}) {
return this.registerApiService.userRegister(data);
}
/**
* 手机号注册
*/
@Post('mobile')
@Public()
async mobileRegister(@Body() data: {
mobile: string;
password: string;
confirm_password: string;
sms_code: string;
invite_code?: string;
}) {
return this.registerApiService.mobileRegister(data);
}
/**
* 邮箱注册
*/
@Post('email')
@Public()
async emailRegister(@Body() data: {
email: string;
password: string;
confirm_password: string;
email_code: string;
invite_code?: string;
}) {
return this.registerApiService.emailRegister(data);
}
/**
* 第三方注册
*/
@Post('third-party')
@Public()
async thirdPartyRegister(@Body() data: {
third_party_type: string;
third_party_id: string;
username?: string;
mobile?: string;
email?: string;
invite_code?: string;
}) {
return this.registerApiService.thirdPartyRegister(data);
}
/**
* 检查用户名是否可用
*/
@Post('check-username')
@Public()
async checkUsername(@Body() data: { username: string }) {
return this.registerApiService.checkUsername(data.username);
}
/**
* 检查手机号是否可用
*/
@Post('check-mobile')
@Public()
async checkMobile(@Body() data: { mobile: string }) {
return this.registerApiService.checkMobile(data.mobile);
}
/**
* 检查邮箱是否可用
*/
@Post('check-email')
@Public()
async checkEmail(@Body() data: { email: string }) {
return this.registerApiService.checkEmail(data.email);
}
}