backendContext在检查用户时的结果不返回给客户端

This commit is contained in:
Xu Chang 2022-10-29 20:17:03 +08:00
parent 02c60d6269
commit fe5be894f9
2 changed files with 16 additions and 4 deletions

View File

@ -40,7 +40,10 @@ var BackendRuntimeContext = /** @class */ (function (_super) {
filter: {
id: appId,
},
}, this, {})];
}, this, {
dontCollect: true,
blockTrigger: true,
})];
case 1:
result = (_b.sent()).result;
(0, assert_1.default)(result.length > 0, "\u6784\u5EFABackendRuntimeContext\u5BF9\u5E94appId\u300C".concat(appId, "\u300D\u627E\u4E0D\u5230application"));
@ -74,7 +77,10 @@ var BackendRuntimeContext = /** @class */ (function (_super) {
filter: {
id: tokenValue,
},
}, this, {})];
}, this, {
dontCollect: true,
blockTrigger: true,
})];
case 3:
result = (_b.sent()).result;
if (result.length === 0) {

View File

@ -56,7 +56,10 @@ export class BackendRuntimeContext<ED extends EntityDict> extends UniversalConte
filter: {
id: appId,
},
}, this, {});
}, this, {
dontCollect: true,
blockTrigger: true,
});
assert(result.length > 0, `构建BackendRuntimeContext对应appId「${appId}」找不到application`);
this.application = result[0] as SelectRowShape<ED['application']['Schema'], GetApplicationShape>;
}
@ -87,7 +90,10 @@ export class BackendRuntimeContext<ED extends EntityDict> extends UniversalConte
filter: {
id: tokenValue,
},
}, this, {});
}, this, {
dontCollect: true,
blockTrigger: true,
});
if (result.length === 0) {
console.log(`构建BackendRuntimeContext对应tokenValue「${tokenValue}找不到相关的user`);
throw new OakTokenExpiredException();