mirror of
https://github.com/certd/certd.git
synced 2026-07-16 02:37:34 +08:00
fix: 修复企业模式下登录报projectId不能为空的问题
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { AccessGetter, AccessService, BaseController, Constants, SysSettingsService } from "@certd/lib-server";
|
import { AccessGetter, AccessService, BaseController, Constants, isEnterprise, SysSettingsService } from "@certd/lib-server";
|
||||||
import { ALL, Body, Controller, Inject, Post, Provide } from "@midwayjs/core";
|
import { ALL, Body, Controller, Inject, Post, Provide } from "@midwayjs/core";
|
||||||
import { PasskeyService } from "../../../modules/login/service/passkey-service.js";
|
import { PasskeyService } from "../../../modules/login/service/passkey-service.js";
|
||||||
import { RoleService } from "../../../modules/sys/authority/service/role-service.js";
|
import { RoleService } from "../../../modules/sys/authority/service/role-service.js";
|
||||||
@@ -55,16 +55,13 @@ export class MineController extends BaseController {
|
|||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
user.needInitPassword = needInitPassword;
|
user.needInitPassword = needInitPassword;
|
||||||
|
|
||||||
const { projectId } = await this.getProjectUserIdRead();
|
|
||||||
const userProjectQuery = this.accessService.buildUserProjectQuery(userId, projectId);
|
|
||||||
const existingAccess = await this.accessService.findOne({
|
const existingAccess = await this.accessService.findOne({
|
||||||
where: { type: "acmeAccount", subtype: "letsencrypt", ...userProjectQuery },
|
where: { type: "acmeAccount", subtype: "letsencrypt", userId },
|
||||||
});
|
});
|
||||||
if (!existingAccess) {
|
if (!existingAccess) {
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
user.needInitAccount = true;
|
user.needInitAccount = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.ok(user);
|
return this.ok(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user