token中取数据的完整性

This commit is contained in:
Xu Chang 2022-09-15 19:32:32 +08:00
parent 51753c97a2
commit 51698d8890
4 changed files with 22 additions and 34 deletions

View File

@ -97,6 +97,10 @@ export declare class FrontendRuntimeContext<ED extends EntityDict, Cxt extends R
id: 1;
userId: 1;
roleId: 1;
role: {
id: 1;
name: 1;
};
};
};
};

View File

@ -18,6 +18,10 @@ declare type TokenProjection = {
id: 1;
userId: 1;
roleId: 1;
role: {
id: 1;
name: 1;
};
};
};
};

View File

@ -17,6 +17,10 @@ var tokenProjection = {
id: 1,
userId: 1,
roleId: 1,
role: {
id: 1,
name: 1,
},
},
},
},
@ -45,23 +49,7 @@ var Token = /** @class */ (function (_super) {
_a.sent();
if (!!this.token) return [3 /*break*/, 3];
return [4 /*yield*/, this.cache.refresh('token', {
data: {
id: 1,
userId: 1,
ableState: 1,
player: {
id: 1,
userRole$user: {
$entity: 'userRole',
data: {
id: 1,
userId: 1,
roleId: 1,
},
},
},
playerId: 1,
},
data: tokenProjection,
filter: {
id: this.tokenValue,
},

View File

@ -23,6 +23,10 @@ type TokenProjection = {
id: 1,
userId: 1,
roleId: 1,
role: {
id: 1,
name: 1,
},
},
},
},
@ -40,6 +44,10 @@ const tokenProjection: TokenProjection = {
id: 1,
userId: 1,
roleId: 1,
role: {
id: 1,
name: 1,
},
},
},
},
@ -76,23 +84,7 @@ export class Token<
await this.rwLock.acquire('X');
if (!this.token) {
const { data } = await this.cache.refresh('token', {
data: {
id: 1,
userId: 1,
ableState: 1,
player: {
id: 1,
userRole$user: {
$entity: 'userRole',
data: {
id: 1,
userId: 1,
roleId: 1,
},
},
},
playerId: 1,
},
data: tokenProjection,
filter: {
id: this.tokenValue!,
},