mirror of
https://github.com/certd/certd.git
synced 2026-04-23 11:37:23 +08:00
fix: 修复1panel 请求失败的bug
This commit is contained in:
@@ -35,16 +35,16 @@ export class HandleController extends BaseController {
|
||||
@Post('/access', { summary: Constants.per.authOnly })
|
||||
async accessRequest(@Body(ALL) body: AccessRequestHandleReq) {
|
||||
const userId = this.getUserId();
|
||||
let inputAccess = body.input.access;
|
||||
if (body.input.id > 0) {
|
||||
const oldEntity = await this.accessService.info(body.input.id);
|
||||
let inputAccess = body.input;
|
||||
if (body.record.id > 0) {
|
||||
const oldEntity = await this.accessService.info(body.record.id);
|
||||
if (oldEntity) {
|
||||
if (oldEntity.userId !== this.getUserId()) {
|
||||
throw new Error('access not found');
|
||||
}
|
||||
const param: any = {
|
||||
type: body.typeName,
|
||||
setting: JSON.stringify(body.input.access),
|
||||
setting: JSON.stringify(body.input),
|
||||
};
|
||||
this.accessService.encryptSetting(param, oldEntity);
|
||||
inputAccess = this.accessService.decryptAccessEntity(param);
|
||||
@@ -53,7 +53,7 @@ export class HandleController extends BaseController {
|
||||
const accessGetter = new AccessGetter(userId, this.accessService.getById.bind(this.accessService));
|
||||
const access = await newAccess(body.typeName, inputAccess,accessGetter);
|
||||
|
||||
mergeUtils.merge(access, body.input);
|
||||
// mergeUtils.merge(access, body.input);
|
||||
const res = await access.onRequest(body);
|
||||
|
||||
return this.ok(res);
|
||||
@@ -61,7 +61,7 @@ export class HandleController extends BaseController {
|
||||
|
||||
@Post('/notification', { summary: Constants.per.authOnly })
|
||||
async notificationRequest(@Body(ALL) body: NotificationRequestHandleReq) {
|
||||
const input = body.input.body;
|
||||
const input = body.input;
|
||||
|
||||
const notification = await newNotification(body.typeName, input, {
|
||||
http,
|
||||
|
||||
Reference in New Issue
Block a user