fix: 修复套餐关闭状态下,仍然限制用户流水线数量的bug

v2
xiaojunnuo 2024-12-25 11:42:42 +08:00
parent a323f3aa2c
commit 66fb9e5f49
2 changed files with 10 additions and 7 deletions

View File

@ -25,7 +25,7 @@ services:
# - 8.8.4.4
# extra_hosts:
# # ↓↓↓↓ -------------------------------------------------------- 这里可以配置自定义hosts外网域名可以指向本地局域网ip地址
# - "localdomain.comm:192.168.1.3"
# - "localdomain.com:192.168.1.3"
environment:
# 设置环境变量即可自定义certd配置

View File

@ -204,6 +204,8 @@ export class PipelineService extends BaseService<PipelineEntity> {
// }
if (isComm()) {
//校验pipelineCount
const suiteSetting = await this.userSuiteService.getSuiteSetting();
if (suiteSetting.enabled) {
const userSuite = await this.userSuiteService.getMySuiteDetail(bean.userId);
if (userSuite?.pipelineCount.max != -1 && userSuite?.pipelineCount.used + 1 > userSuite?.pipelineCount.max) {
throw new NeedSuiteException(`对不起,您最多只能创建${userSuite?.pipelineCount.max}条流水线,请购买或升级套餐`);
@ -213,6 +215,7 @@ export class PipelineService extends BaseService<PipelineEntity> {
throw new NeedSuiteException(`对不起,您最多只能添加${userSuite.domainCount.max}个域名,请购买或升级套餐`);
}
}
}
const userId = bean.userId;
const userIsAdmin = await this.userService.isAdmin(userId);