mirror of
https://github.com/vastxie/99AI.git
synced 2025-11-13 04:03:45 +08:00
v3.3.3
This commit is contained in:
89
dist/modules/auth/auth.controller.js
vendored
89
dist/modules/auth/auth.controller.js
vendored
@@ -13,18 +13,13 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.AuthController = void 0;
|
||||
const verifyCode_dto_1 = require("./../verification/dto/verifyCode.dto");
|
||||
const authLogin_dto_1 = require("./dto/authLogin.dto");
|
||||
const common_1 = require("@nestjs/common");
|
||||
const jwtAuth_guard_1 = require("../../common/auth/jwtAuth.guard");
|
||||
const auth_service_1 = require("./auth.service");
|
||||
const common_1 = require("@nestjs/common");
|
||||
const swagger_1 = require("@nestjs/swagger");
|
||||
const authRegister_dto_1 = require("./dto/authRegister.dto");
|
||||
const updatePassword_dto_1 = require("./dto/updatePassword.dto");
|
||||
const auth_service_1 = require("./auth.service");
|
||||
const authLogin_dto_1 = require("./dto/authLogin.dto");
|
||||
const updatePassByOther_dto_1 = require("./dto/updatePassByOther.dto");
|
||||
const sendPhoneCode_dto_1 = require("./dto/sendPhoneCode.dto");
|
||||
const userRegisterByPhone_dto_1 = require("./dto/userRegisterByPhone.dto");
|
||||
const loginByPhone_dt_1 = require("./dto/loginByPhone.dt");
|
||||
const updatePassword_dto_1 = require("./dto/updatePassword.dto");
|
||||
let AuthController = class AuthController {
|
||||
constructor(authService) {
|
||||
this.authService = authService;
|
||||
@@ -32,15 +27,9 @@ let AuthController = class AuthController {
|
||||
async register(body, req) {
|
||||
return await this.authService.register(body, req);
|
||||
}
|
||||
async registerByPhone(body, req) {
|
||||
return await this.authService.registerByPhone(body, req);
|
||||
}
|
||||
async login(body, req) {
|
||||
return this.authService.login(body, req);
|
||||
}
|
||||
async loginByPhone(body, req) {
|
||||
return this.authService.loginByPhone(body, req);
|
||||
}
|
||||
async updatePassword(req, body) {
|
||||
return this.authService.updatePassword(req, body);
|
||||
}
|
||||
@@ -50,22 +39,11 @@ let AuthController = class AuthController {
|
||||
async getInfo(req) {
|
||||
return this.authService.getInfo(req);
|
||||
}
|
||||
async activateAccount(parmas, res) {
|
||||
return this.authService.activateAccount(parmas, res);
|
||||
}
|
||||
async registerSuccess(parmas) {
|
||||
const { username, id, email, teamName, registerSuccessEmailTitle, registerSuccessEmailTeamName, registerSuccessEmaileAppend } = parmas;
|
||||
return { username, id, email, teamName, registerSuccessEmailTitle, registerSuccessEmailTeamName, registerSuccessEmaileAppend };
|
||||
}
|
||||
async registerError(parmas) {
|
||||
const { message, teamName, registerFailEmailTitle, registerFailEmailTeamName } = parmas;
|
||||
return { message, teamName, registerFailEmailTitle, registerFailEmailTeamName };
|
||||
}
|
||||
async captcha(parmas) {
|
||||
return this.authService.captcha(parmas);
|
||||
}
|
||||
async sendPhoneCode(parmas) {
|
||||
return this.authService.sendPhoneCode(parmas);
|
||||
async sendCode(parmas) {
|
||||
return this.authService.sendCode(parmas);
|
||||
}
|
||||
};
|
||||
__decorate([
|
||||
@@ -74,18 +52,9 @@ __decorate([
|
||||
__param(0, (0, common_1.Body)()),
|
||||
__param(1, (0, common_1.Req)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [authRegister_dto_1.UserRegisterDto, Object]),
|
||||
__metadata("design:paramtypes", [Object, Object]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], AuthController.prototype, "register", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)('registerByPhone'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '用户通过手机号注册' }),
|
||||
__param(0, (0, common_1.Body)()),
|
||||
__param(1, (0, common_1.Req)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [userRegisterByPhone_dto_1.UserRegisterByPhoneDto, Object]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], AuthController.prototype, "registerByPhone", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)('login'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '用户登录' }),
|
||||
@@ -95,15 +64,6 @@ __decorate([
|
||||
__metadata("design:paramtypes", [authLogin_dto_1.UserLoginDto, Object]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], AuthController.prototype, "login", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)('loginByPhone'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '用户手机号登录' }),
|
||||
__param(0, (0, common_1.Body)()),
|
||||
__param(1, (0, common_1.Req)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [loginByPhone_dt_1.LoginByPhoneDto, Object]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], AuthController.prototype, "loginByPhone", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)('updatePassword'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '用户更改密码' }),
|
||||
@@ -136,33 +96,6 @@ __decorate([
|
||||
__metadata("design:paramtypes", [Object]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], AuthController.prototype, "getInfo", null);
|
||||
__decorate([
|
||||
(0, common_1.Get)('activateAccount'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '账户激活' }),
|
||||
__param(0, (0, common_1.Query)()),
|
||||
__param(1, (0, common_1.Res)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [verifyCode_dto_1.VerifyCodeDto, Object]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], AuthController.prototype, "activateAccount", null);
|
||||
__decorate([
|
||||
(0, common_1.Get)('registerSuccess'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '注册成功页面' }),
|
||||
(0, common_1.Render)('registerSuccess'),
|
||||
__param(0, (0, common_1.Query)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], AuthController.prototype, "registerSuccess", null);
|
||||
__decorate([
|
||||
(0, common_1.Get)('registerError'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '注册失败页面' }),
|
||||
(0, common_1.Render)('registerError'),
|
||||
__param(0, (0, common_1.Query)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], AuthController.prototype, "registerError", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)('captcha'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '获取一个图形验证码' }),
|
||||
@@ -172,13 +105,13 @@ __decorate([
|
||||
__metadata("design:returntype", Promise)
|
||||
], AuthController.prototype, "captcha", null);
|
||||
__decorate([
|
||||
(0, common_1.Post)('sendPhoneCode'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '发送手机验证码' }),
|
||||
(0, common_1.Post)('sendCode'),
|
||||
(0, swagger_1.ApiOperation)({ summary: '发送验证码' }),
|
||||
__param(0, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [sendPhoneCode_dto_1.SendPhoneCodeDto]),
|
||||
__metadata("design:paramtypes", [Object]),
|
||||
__metadata("design:returntype", Promise)
|
||||
], AuthController.prototype, "sendPhoneCode", null);
|
||||
], AuthController.prototype, "sendCode", null);
|
||||
AuthController = __decorate([
|
||||
(0, swagger_1.ApiTags)('auth'),
|
||||
(0, common_1.Controller)('auth'),
|
||||
|
||||
Reference in New Issue
Block a user