mirror of
https://github.com/vastxie/99AI.git
synced 2025-11-15 13:13:42 +08:00
v-3.0.0
This commit is contained in:
2
dist/modules/user/dto/updateUser.dto.js
vendored
2
dist/modules/user/dto/updateUser.dto.js
vendored
@@ -23,7 +23,7 @@ __decorate([
|
||||
__metadata("design:type", String)
|
||||
], UpdateUserDto.prototype, "username", void 0);
|
||||
__decorate([
|
||||
(0, swagger_1.ApiProperty)({ example: 'https://file.jiangly.com/images/93971628.jpeg', description: '用户头像', required: false }),
|
||||
(0, swagger_1.ApiProperty)({ example: '', description: '用户头像', required: false }),
|
||||
(0, class_validator_1.IsNotEmpty)({ message: '用户头像不能为空!' }),
|
||||
(0, class_validator_1.IsOptional)(),
|
||||
__metadata("design:type", String)
|
||||
|
||||
2
dist/modules/user/user.entity.js
vendored
2
dist/modules/user/user.entity.js
vendored
@@ -42,7 +42,7 @@ __decorate([
|
||||
(0, typeorm_1.Column)({
|
||||
length: 300,
|
||||
nullable: true,
|
||||
default: 'https://public-1300678944.cos.ap-shanghai.myqcloud.com/ai/7f042f63f.png',
|
||||
default: '',
|
||||
comment: '用户头像',
|
||||
}),
|
||||
__metadata("design:type", String)
|
||||
|
||||
2
dist/modules/user/user.module.js
vendored
2
dist/modules/user/user.module.js
vendored
@@ -19,7 +19,7 @@ const balance_entity_1 = require("../userBalance/balance.entity");
|
||||
const accountLog_entity_1 = require("../userBalance/accountLog.entity");
|
||||
const config_entity_1 = require("../globalConfig/config.entity");
|
||||
const cramiPackage_entity_1 = require("../crami/cramiPackage.entity");
|
||||
const whiteList_entity_1 = require("../chatgpt/whiteList.entity");
|
||||
const whiteList_entity_1 = require("../chat/whiteList.entity");
|
||||
const userBalance_entity_1 = require("../userBalance/userBalance.entity");
|
||||
const salesUsers_entity_1 = require("../sales/salesUsers.entity");
|
||||
const redisCache_service_1 = require("../redisCache/redisCache.service");
|
||||
|
||||
11
dist/modules/user/user.service.js
vendored
11
dist/modules/user/user.service.js
vendored
@@ -28,7 +28,7 @@ const userBalance_service_1 = require("../userBalance/userBalance.service");
|
||||
const utils_1 = require("../../common/utils");
|
||||
const balance_constant_1 = require("../../common/constants/balance.constant");
|
||||
const config_entity_1 = require("../globalConfig/config.entity");
|
||||
const whiteList_entity_1 = require("../chatgpt/whiteList.entity");
|
||||
const whiteList_entity_1 = require("../chat/whiteList.entity");
|
||||
let UserService = class UserService {
|
||||
constructor(userEntity, whiteListEntity, connection, verificationService, mailerService, userBalanceService, globalConfigService, configEntity) {
|
||||
this.userEntity = userEntity;
|
||||
@@ -265,8 +265,9 @@ let UserService = class UserService {
|
||||
const { inviteCode } = u;
|
||||
if (!inviteCode)
|
||||
return [];
|
||||
const invitedBy = inviteCode;
|
||||
const [rows, count] = await this.userEntity.findAndCount({
|
||||
where: { inviteCode },
|
||||
where: { invitedBy },
|
||||
order: { id: 'DESC' },
|
||||
select: ['username', 'email', 'createdAt', 'status', 'avatar'],
|
||||
take: size,
|
||||
@@ -350,15 +351,9 @@ let UserService = class UserService {
|
||||
if (n.role === 'super') {
|
||||
throw new common_1.HttpException('超级管理员不可被操作!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
if (n.status === user_constant_1.UserStatusEnum.PENDING) {
|
||||
throw new common_1.HttpException('未激活用户不可手动变更状态!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
if (n.role === 'super') {
|
||||
throw new common_1.HttpException('超级管理员不可被操作!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
if (status === user_constant_1.UserStatusEnum.PENDING) {
|
||||
throw new common_1.HttpException('不可将用户置为未激活状态!', common_1.HttpStatus.BAD_REQUEST);
|
||||
}
|
||||
const r = await this.userEntity.update({ id }, { status });
|
||||
if (r.affected <= 0) {
|
||||
throw new common_1.HttpException('修改用户状态失败!', common_1.HttpStatus.BAD_REQUEST);
|
||||
|
||||
Reference in New Issue
Block a user