volatile trigger在makesure条件下清除triggerAttribute时,要开启root 模式
This commit is contained in:
parent
fa0866e0f8
commit
021774a154
|
|
@ -748,6 +748,11 @@ function tryCopyPages(cwdPageDir, modulePageDir) {
|
|||
function tryCopyModuleTemplateFiles(cwd, dependencies, briefNames, printer) {
|
||||
const injectDataIndexFileDependencies = [];
|
||||
const injectDataIndexFileBriefNames = [];
|
||||
const webDir = join(cwd, 'web');
|
||||
if (!(0, fs_1.existsSync)(webDir)) {
|
||||
// 如果没有web目录,说明是module,不需要处理模块级别的文件注入
|
||||
return;
|
||||
}
|
||||
dependencies.forEach((dep, idx) => {
|
||||
const moduleDir = join(cwd, 'node_modules', dep);
|
||||
const moduleTemplateDir = join(moduleDir, 'template');
|
||||
|
|
|
|||
|
|
@ -335,6 +335,8 @@ class TriggerExecutor {
|
|||
const { fn } = trigger;
|
||||
const callback = await fn({ ids }, context, option);
|
||||
if (trigger.strict === 'makeSure') {
|
||||
// 这里开root模式,否则还可能有权限问题
|
||||
context.openRootMode();
|
||||
await context.operate(entity, {
|
||||
id: await (0, uuid_1.generateNewIdAsync)(),
|
||||
action: 'update',
|
||||
|
|
|
|||
|
|
@ -1411,6 +1411,12 @@ function tryCopyModuleTemplateFiles(
|
|||
const injectDataIndexFileDependencies: string[] = [];
|
||||
const injectDataIndexFileBriefNames: string[] = [];
|
||||
|
||||
const webDir = join(cwd, 'web');
|
||||
if (!existsSync(webDir)) {
|
||||
// 如果没有web目录,说明是module,不需要处理模块级别的文件注入
|
||||
return;
|
||||
}
|
||||
|
||||
dependencies.forEach(
|
||||
(dep, idx) => {
|
||||
const moduleDir = join(cwd, 'node_modules', dep);
|
||||
|
|
|
|||
|
|
@ -426,6 +426,8 @@ export class TriggerExecutor<ED extends EntityDict & BaseEntityDict, Cxt extends
|
|||
const { fn } = trigger as VolatileTrigger<ED, T, Cxt>;
|
||||
const callback = await fn({ ids }, context, option);
|
||||
if (trigger.strict === 'makeSure') {
|
||||
// 这里开root模式,否则还可能有权限问题
|
||||
context.openRootMode();
|
||||
await context.operate(entity, {
|
||||
id: await generateNewIdAsync(),
|
||||
action: 'update',
|
||||
|
|
|
|||
Loading…
Reference in New Issue