feat: 优化判断路径,检查并添加部分忽略注释

This commit is contained in:
Pan Qiancheng 2026-01-05 10:33:17 +08:00
parent 09b1207af3
commit 86b9f217af
6 changed files with 1350 additions and 919 deletions

File diff suppressed because it is too large Load Diff

View File

@ -31,6 +31,7 @@ class RelationAuth {
if (context.isRoot()) {
return;
}
// @oak-ignore 这里只有纯前台会跑到,一定是同步的
this.checkActions2(entity, operation, context);
}
// 后台检查filter是否满足relation约束

View File

@ -1566,6 +1566,7 @@ function checkDeduceFilters(dfc, context) {
const andResult = $and.map((ele) => {
if (ele.hasOwnProperty('entity')) {
const ele2 = ele;
// @oak-ignore
return context.count(ele2.entity, {
filter: ele2.filter
}, { ignoreAttrMiss: true });
@ -1595,6 +1596,7 @@ function checkDeduceFilters(dfc, context) {
const orResult = $or.map((ele) => {
if (ele.hasOwnProperty('entity')) {
const ele2 = ele;
// @oak-ignore
return context.count(ele2.entity, {
filter: ele2.filter
}, { ignoreAttrMiss: true });

File diff suppressed because it is too large Load Diff

View File

@ -69,6 +69,7 @@ export class RelationAuth<ED extends EntityDict & BaseEntityDict> {
return;
}
// @oak-ignore 这里只有纯前台会跑到,一定是同步的
this.checkActions2(entity, operation, context);
}

View File

@ -1783,6 +1783,7 @@ function checkDeduceFilters<ED extends EntityDict & BaseEntityDict, Cxt extends
(ele) => {
if (ele.hasOwnProperty('entity')) {
const ele2 = ele as DeducedFilter<ED, keyof ED>;
// @oak-ignore
return context.count(ele2.entity, {
filter: ele2.filter
}, { ignoreAttrMiss: true });
@ -1818,6 +1819,7 @@ function checkDeduceFilters<ED extends EntityDict & BaseEntityDict, Cxt extends
(ele) => {
if (ele.hasOwnProperty('entity')) {
const ele2 = ele as DeducedFilter<ED, keyof ED>;
// @oak-ignore
return context.count(ele2.entity, {
filter: ele2.filter
}, { ignoreAttrMiss: true });