chore: project finished

This commit is contained in:
xiaojunnuo
2026-03-03 23:31:42 +08:00
parent a853fc2026
commit 6c546b5290
17 changed files with 87 additions and 29 deletions
@@ -1,5 +1,5 @@
import { AccessService } from "@certd/lib-server";
import { ALL, Body, Controller, Inject, Post, Provide, Query } from "@midwayjs/core";
import { AccessService, Constants } from "@certd/lib-server";
import { AccessController } from "../../user/pipeline/access-controller.js";
/**
@@ -15,6 +15,12 @@ export class SysAccessController extends AccessController {
return this.service2;
}
async getProjectUserId(permission:string){
return {
projectId:null,userId:0
}
}
getUserId() {
// checkComm();
return 0;
@@ -54,7 +60,7 @@ export class SysAccessController extends AccessController {
return await super.define(type);
}
@Post('/getSecretPlain', { summary: Constants.per.authOnly })
@Post('/getSecretPlain', { summary: 'sys:settings:view' })
async getSecretPlain(@Body(ALL) body: { id: number; key: string }) {
const value = await this.service.getById(body.id, 0);
return this.ok(value[body.key]);
@@ -69,4 +75,9 @@ export class SysAccessController extends AccessController {
async simpleInfo(@Query('id') id: number) {
return await super.simpleInfo(id);
}
@Post('/getDictByIds', { summary: 'sys:settings:view' })
async getDictByIds(@Body('ids') ids: number[]) {
return await super.getDictByIds(ids);
}
}
@@ -12,6 +12,11 @@ export class SysAddonController extends AddonController {
return this.service2;
}
async getProjectUserId(permission:string){
return {
projectId:null,userId:0
}
}
getUserId() {
// checkComm();
return 0;
@@ -60,10 +60,12 @@ export class SysProjectMemberController extends CrudController<ProjectMemberEnti
userId: this.getUserId(),
projectId: projectId,
});
return super.update({
const res =await this.service.update({
id: bean.id,
permission: bean.permission,
status: bean.status,
});
return this.ok(res);
}
@Post("/info", { summary: "sys:settings:view" })
@@ -64,10 +64,13 @@ export class ProjectMemberController extends CrudController<ProjectMemberEntity>
userId: this.getUserId(),
projectId: projectId,
});
return super.update({
const res = await this.service.update({
id: bean.id,
permission: bean.permission,
status: bean.status,
});
return this.ok(res);
}
@Post("/info", { summary: Constants.per.authOnly })
@@ -111,7 +111,7 @@ export class AccessController extends CrudController<AccessService> {
@Post('/simpleInfo', { summary: Constants.per.authOnly })
async simpleInfo(@Query('id') id: number) {
// await this.authService.checkUserIdButAllowAdmin(this.ctx, this.service, id);
await this.checkOwner(this.getService(), id, "read",true);
// await this.checkOwner(this.getService(), id, "read",true);
const res = await this.service.getSimpleInfo(id);
return this.ok(res);
}