mirror of
https://github.com/certd/certd.git
synced 2026-04-24 04:17:25 +08:00
chore: project finished
This commit is contained in:
@@ -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" })
|
||||
|
||||
+4
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user