mirror of
https://github.com/certd/certd.git
synced 2026-04-24 04:17:25 +08:00
chore: project controller ok
This commit is contained in:
@@ -65,7 +65,13 @@ export abstract class BaseController {
|
||||
if (!isEnterprise()) {
|
||||
return null
|
||||
}
|
||||
const projectIdStr = this.ctx.headers["project-id"] as string;
|
||||
let projectIdStr = this.ctx.headers["project-id"] as string;
|
||||
if (!projectIdStr){
|
||||
projectIdStr = this.ctx.request.query["projectId"] as string;
|
||||
}
|
||||
if (!projectIdStr){
|
||||
return null
|
||||
}
|
||||
if (!projectIdStr) {
|
||||
throw new Error("projectId 不能为空")
|
||||
}
|
||||
|
||||
@@ -233,13 +233,14 @@ export abstract class BaseService<T> {
|
||||
throw new PermissionException('权限不足');
|
||||
}
|
||||
|
||||
async batchDelete(ids: number[], userId: number) {
|
||||
if(userId >0){
|
||||
async batchDelete(ids: number[], userId: number,projectId?:number) {
|
||||
if(userId!=null){
|
||||
const list = await this.getRepository().find({
|
||||
where: {
|
||||
// @ts-ignore
|
||||
id: In(ids),
|
||||
userId,
|
||||
projectId,
|
||||
},
|
||||
})
|
||||
// @ts-ignore
|
||||
|
||||
Reference in New Issue
Block a user