mirror of
https://github.com/certd/certd.git
synced 2026-04-24 12:27:25 +08:00
chore:
This commit is contained in:
@@ -42,6 +42,7 @@ async function getDeviceId() {
|
||||
|
||||
modal.confirm({
|
||||
title: "请输入OTP验证码",
|
||||
maskClosable: true,
|
||||
content: () => {
|
||||
return (
|
||||
<a-form-item-rest>
|
||||
|
||||
@@ -135,6 +135,7 @@ function openUpgrade() {
|
||||
async onOk() {
|
||||
return await doActive();
|
||||
},
|
||||
maskClosable: true,
|
||||
okText: "激活",
|
||||
width: 500,
|
||||
content: () => {
|
||||
|
||||
@@ -130,7 +130,7 @@ export const useUserStore = defineStore({
|
||||
*/
|
||||
confirmLoginOut() {
|
||||
const { t } = useI18n();
|
||||
Modal.config({
|
||||
Modal.confirm({
|
||||
iconType: "warning",
|
||||
title: t("app.login.logoutTip"),
|
||||
content: t("app.login.logoutMessage"),
|
||||
|
||||
@@ -235,6 +235,7 @@ export default function ({ crudExpose, context: { certdFormRef } }: CreateCrudOp
|
||||
const files = await api.GetFiles(row.id);
|
||||
Modal.success({
|
||||
title: "文件下载",
|
||||
maskClosable: true,
|
||||
okText: "↑↑↑ 点击上面链接下载",
|
||||
content: () => {
|
||||
const children = [];
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
import { ALL, Body, Controller, Inject, Post, Provide } from '@midwayjs/core';
|
||||
import { Constants } from '../../../basic/constants.js';
|
||||
import {
|
||||
accessRegistry,
|
||||
AccessRequestHandleContext,
|
||||
AccessRequestHandleReq,
|
||||
http,
|
||||
ITaskPlugin,
|
||||
logger,
|
||||
mergeUtils,
|
||||
newAccess,
|
||||
pluginRegistry,
|
||||
PluginRequestHandleReq,
|
||||
TaskInstanceContext,
|
||||
@@ -28,15 +27,6 @@ export class HandleController extends BaseController {
|
||||
|
||||
@Post('/access', { summary: Constants.per.authOnly })
|
||||
async accessRequest(@Body(ALL) body: AccessRequestHandleReq) {
|
||||
const accessItem = accessRegistry.get(body.typeName);
|
||||
const accessCls = accessItem.target;
|
||||
if (accessCls == null) {
|
||||
throw new Error(`access ${body.typeName} not found`);
|
||||
}
|
||||
//实例化access
|
||||
//@ts-ignore
|
||||
const access = new accessCls();
|
||||
|
||||
let inputAccess = body.input.access;
|
||||
if (body.input.id > 0) {
|
||||
const oldEntity = await this.accessService.info(body.input.id);
|
||||
@@ -49,14 +39,10 @@ export class HandleController extends BaseController {
|
||||
inputAccess = this.accessService.decryptAccessEntity(param);
|
||||
}
|
||||
}
|
||||
mergeUtils.merge(access, inputAccess);
|
||||
|
||||
const ctx: AccessRequestHandleContext = {
|
||||
http: http,
|
||||
logger: logger,
|
||||
utils,
|
||||
};
|
||||
const res = await access.onRequest(body, ctx);
|
||||
const access = newAccess(body.typeName, inputAccess);
|
||||
|
||||
const res = await access.onRequest(body);
|
||||
|
||||
return this.ok(res);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { InjectEntityModel } from '@midwayjs/typeorm';
|
||||
import { Repository } from 'typeorm';
|
||||
import { BaseService } from '../../../basic/base-service.js';
|
||||
import { AccessEntity } from '../entity/access.js';
|
||||
import { AccessDefine, accessRegistry, IAccessService } from '@certd/pipeline';
|
||||
import { AccessDefine, accessRegistry, IAccessService, newAccess } from '@certd/pipeline';
|
||||
import { EncryptService } from './encrypt-service.js';
|
||||
import { ValidateException } from '../../../basic/exception/validation-exception.js';
|
||||
|
||||
@@ -109,10 +109,11 @@ export class AccessService extends BaseService<AccessEntity> implements IAccessS
|
||||
}
|
||||
// const access = accessRegistry.get(entity.type);
|
||||
const setting = this.decryptAccessEntity(entity);
|
||||
return {
|
||||
const input = {
|
||||
id: entity.id,
|
||||
...setting,
|
||||
};
|
||||
return newAccess(entity.type, input);
|
||||
}
|
||||
|
||||
decryptAccessEntity(entity: AccessEntity): any {
|
||||
|
||||
Reference in New Issue
Block a user