Merge branch 'dev' into release

This commit is contained in:
Xu Chang 2024-09-30 12:12:27 +08:00
commit ce3b3fcd7e
4 changed files with 24 additions and 36 deletions

View File

@ -351,11 +351,15 @@ export class Cache extends Feature {
return this.entityActionAuthDict[ts][entity][id][checkTypeString][action];
}
}
const rollback = this.begin(true);
let rollback = this.begin(true);
try {
this.cacheStore.check(entity, operation, this.context, checkerTypes);
checkerTypes?.includes('relation') && this.baseRelationAuth.checkRelationSync(entity, operation, this.context);
rollback && rollback();
if (checkerTypes?.includes('relation')) {
rollback = this.begin(true);
this.baseRelationAuth.checkRelationSync(entity, operation, this.context);
rollback && rollback();
}
if (id && ts) {
set(this.entityActionAuthDict, `${ts}.${entity}.${id}.${checkTypeString}.${action}`, true);
}
@ -568,22 +572,10 @@ export class Cache extends Feature {
nodeInSet[ref] = [entity];
}
if (nodeOutSet[entity]) {
// 如果外键ref是user 使用属性名(user)以解决relation/entityList页面授权路径不对的问题
if (ref === "user") {
nodeOutSet[entity].push(`${attr.replace('Id', '')}(${ref})`);
}
else {
nodeOutSet[entity].push(`${attr.replace('Id', '')}`);
}
nodeOutSet[entity].push(ref);
}
else {
// 如果外键ref是user 使用属性名(user)以解决relation/entityList页面授权路径不对的问题
if (ref === "user") {
nodeOutSet[entity] = [`${attr.replace('Id', '')}(${ref})`];
}
else {
nodeOutSet[entity] = [`${attr.replace('Id', '')}`];
}
nodeOutSet[entity] = [ref];
}
}
}

View File

@ -354,11 +354,15 @@ class Cache extends Feature_1.Feature {
return this.entityActionAuthDict[ts][entity][id][checkTypeString][action];
}
}
const rollback = this.begin(true);
let rollback = this.begin(true);
try {
this.cacheStore.check(entity, operation, this.context, checkerTypes);
checkerTypes?.includes('relation') && this.baseRelationAuth.checkRelationSync(entity, operation, this.context);
rollback && rollback();
if (checkerTypes?.includes('relation')) {
rollback = this.begin(true);
this.baseRelationAuth.checkRelationSync(entity, operation, this.context);
rollback && rollback();
}
if (id && ts) {
(0, lodash_1.set)(this.entityActionAuthDict, `${ts}.${entity}.${id}.${checkTypeString}.${action}`, true);
}

View File

@ -1,6 +1,6 @@
{
"name": "oak-frontend-base",
"version": "5.3.11",
"version": "5.3.12",
"description": "oak框架中前端与业务逻辑无关的平台部分",
"author": {
"name": "XuChang"
@ -24,7 +24,7 @@
"node-schedule": "^2.1.1",
"nprogress": "^0.2.0",
"oak-common-aspect": "^3.0.2",
"oak-domain": "^5.1.3",
"oak-domain": "^5.1.4",
"oak-memory-tree-store": "^3.3.6",
"ol": "^7.3.0",
"react-activation": "^0.12.4",

View File

@ -493,11 +493,15 @@ export class Cache<ED extends EntityDict & BaseEntityDict> extends Feature {
}
}
const rollback = this.begin(true);
let rollback = this.begin(true);
try {
this.cacheStore!.check(entity, operation, this.context!, checkerTypes);
checkerTypes?.includes('relation') && this.baseRelationAuth.checkRelationSync(entity, operation as Omit<ED[T]['Operation'], 'id'>, this.context!);
rollback && rollback();
if (checkerTypes?.includes('relation')) {
rollback = this.begin(true);
this.baseRelationAuth.checkRelationSync(entity, operation as Omit<ED[T]['Operation'], 'id'>, this.context!);
rollback && rollback();
}
if (id && ts) {
set(this.entityActionAuthDict, `${ts}.${entity as string}.${id}.${checkTypeString}.${action}`, true);
}
@ -765,22 +769,10 @@ export class Cache<ED extends EntityDict & BaseEntityDict> extends Feature {
nodeInSet[ref] = [entity];
}
if (nodeOutSet[entity]) {
// 如果外键ref是user 使用属性名(user)以解决relation/entityList页面授权路径不对的问题
if (ref === "user") {
nodeOutSet[entity].push(`${attr.replace('Id', '')}(${ref})`);
}
else {
nodeOutSet[entity].push(`${attr.replace('Id', '')}`);
}
nodeOutSet[entity].push(ref);
}
else {
// 如果外键ref是user 使用属性名(user)以解决relation/entityList页面授权路径不对的问题
if (ref === "user") {
nodeOutSet[entity] = [`${attr.replace('Id', '')}(${ref})`];
}
else {
nodeOutSet[entity] = [`${attr.replace('Id', '')}`];
}
nodeOutSet[entity] = [ref];
}
}
}