mirror of
https://github.com/vastxie/99AI.git
synced 2025-09-18 01:36:37 +08:00
121 lines
5.2 KiB
JavaScript
121 lines
5.2 KiB
JavaScript
"use strict";
|
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
};
|
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
};
|
|
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
};
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.AuthController = void 0;
|
|
const jwtAuth_guard_1 = require("../../common/auth/jwtAuth.guard");
|
|
const common_1 = require("@nestjs/common");
|
|
const swagger_1 = require("@nestjs/swagger");
|
|
const auth_service_1 = require("./auth.service");
|
|
const authLogin_dto_1 = require("./dto/authLogin.dto");
|
|
const updatePassByOther_dto_1 = require("./dto/updatePassByOther.dto");
|
|
const updatePassword_dto_1 = require("./dto/updatePassword.dto");
|
|
let AuthController = class AuthController {
|
|
constructor(authService) {
|
|
this.authService = authService;
|
|
}
|
|
async register(body, req) {
|
|
return await this.authService.register(body, req);
|
|
}
|
|
async login(body, req) {
|
|
return this.authService.login(body, req);
|
|
}
|
|
async updatePassword(req, body) {
|
|
return this.authService.updatePassword(req, body);
|
|
}
|
|
async updatePassByOther(req, body) {
|
|
return this.authService.updatePassByOther(req, body);
|
|
}
|
|
async getInfo(req) {
|
|
return this.authService.getInfo(req);
|
|
}
|
|
async captcha(parmas) {
|
|
return this.authService.captcha(parmas);
|
|
}
|
|
async sendCode(parmas) {
|
|
return this.authService.sendCode(parmas);
|
|
}
|
|
};
|
|
__decorate([
|
|
(0, common_1.Post)('register'),
|
|
(0, swagger_1.ApiOperation)({ summary: '用户注册' }),
|
|
__param(0, (0, common_1.Body)()),
|
|
__param(1, (0, common_1.Req)()),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", [Object, Object]),
|
|
__metadata("design:returntype", Promise)
|
|
], AuthController.prototype, "register", null);
|
|
__decorate([
|
|
(0, common_1.Post)('login'),
|
|
(0, swagger_1.ApiOperation)({ summary: '用户登录' }),
|
|
__param(0, (0, common_1.Body)()),
|
|
__param(1, (0, common_1.Req)()),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", [authLogin_dto_1.UserLoginDto, Object]),
|
|
__metadata("design:returntype", Promise)
|
|
], AuthController.prototype, "login", null);
|
|
__decorate([
|
|
(0, common_1.Post)('updatePassword'),
|
|
(0, swagger_1.ApiOperation)({ summary: '用户更改密码' }),
|
|
(0, common_1.UseGuards)(jwtAuth_guard_1.JwtAuthGuard),
|
|
(0, swagger_1.ApiBearerAuth)(),
|
|
__param(0, (0, common_1.Req)()),
|
|
__param(1, (0, common_1.Body)()),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", [Object, updatePassword_dto_1.UpdatePasswordDto]),
|
|
__metadata("design:returntype", Promise)
|
|
], AuthController.prototype, "updatePassword", null);
|
|
__decorate([
|
|
(0, common_1.Post)('updatePassByOther'),
|
|
(0, swagger_1.ApiOperation)({ summary: '用户更改密码' }),
|
|
(0, common_1.UseGuards)(jwtAuth_guard_1.JwtAuthGuard),
|
|
(0, swagger_1.ApiBearerAuth)(),
|
|
__param(0, (0, common_1.Req)()),
|
|
__param(1, (0, common_1.Body)()),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", [Object, updatePassByOther_dto_1.UpdatePassByOtherDto]),
|
|
__metadata("design:returntype", Promise)
|
|
], AuthController.prototype, "updatePassByOther", null);
|
|
__decorate([
|
|
(0, common_1.Get)('getInfo'),
|
|
(0, swagger_1.ApiOperation)({ summary: '获取用户个人信息' }),
|
|
(0, common_1.UseGuards)(jwtAuth_guard_1.JwtAuthGuard),
|
|
(0, swagger_1.ApiBearerAuth)(),
|
|
__param(0, (0, common_1.Req)()),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", [Object]),
|
|
__metadata("design:returntype", Promise)
|
|
], AuthController.prototype, "getInfo", null);
|
|
__decorate([
|
|
(0, common_1.Post)('captcha'),
|
|
(0, swagger_1.ApiOperation)({ summary: '获取一个图形验证码' }),
|
|
__param(0, (0, common_1.Body)()),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", [Object]),
|
|
__metadata("design:returntype", Promise)
|
|
], AuthController.prototype, "captcha", null);
|
|
__decorate([
|
|
(0, common_1.Post)('sendCode'),
|
|
(0, swagger_1.ApiOperation)({ summary: '发送验证码' }),
|
|
__param(0, (0, common_1.Body)()),
|
|
__metadata("design:type", Function),
|
|
__metadata("design:paramtypes", [Object]),
|
|
__metadata("design:returntype", Promise)
|
|
], AuthController.prototype, "sendCode", null);
|
|
AuthController = __decorate([
|
|
(0, swagger_1.ApiTags)('auth'),
|
|
(0, common_1.Controller)('auth'),
|
|
__metadata("design:paramtypes", [auth_service_1.AuthService])
|
|
], AuthController);
|
|
exports.AuthController = AuthController;
|