fix: change import acl

This commit is contained in:
Semmy 2022-10-31 23:34:14 +08:00
parent 89af2175de
commit dfab92b175

View File

@ -5,7 +5,6 @@ import { enUS, zhCN } from './locale';
import { importMiddleware } from './middleware'; import { importMiddleware } from './middleware';
export class ImportPlugin extends Plugin { export class ImportPlugin extends Plugin {
beforeLoad() { beforeLoad() {
this.app.i18n.addResources('zh-CN', namespace, zhCN); this.app.i18n.addResources('zh-CN', namespace, zhCN);
this.app.i18n.addResources('en-US', namespace, enUS); this.app.i18n.addResources('en-US', namespace, enUS);
@ -25,6 +24,8 @@ export class ImportPlugin extends Plugin {
this.app.acl.setAvailableAction('importXlsx', { this.app.acl.setAvailableAction('importXlsx', {
displayName: '{{t("Import")}}', displayName: '{{t("Import")}}',
allowConfigureFields: true, allowConfigureFields: true,
type: 'new-data',
onNewRecord: true,
}); });
this.app.acl.use(async (ctx, next) => { this.app.acl.use(async (ctx, next) => {
const { actionName } = ctx.action; const { actionName } = ctx.action;