aspects token 返回数据 user补充完整些

This commit is contained in:
Wang Kejun 2022-12-19 11:29:52 +08:00
parent 1389785658
commit 36324b73f5
4 changed files with 104 additions and 22 deletions

View File

@ -269,8 +269,46 @@ function loadTokenInfo(tokenId, context) {
ableState: 1,
user: {
id: 1,
name: 1,
nickname: 1,
name: 1,
userState: 1,
extraFile$entity: {
$entity: 'extraFile',
data: {
id: 1,
tag1: 1,
origin: 1,
bucket: 1,
objectId: 1,
filename: 1,
extra1: 1,
type: 1,
entity: 1,
entityId: 1,
extension: 1,
},
filter: {
tag1: 'avatar',
},
indexFrom: 0,
count: 1,
},
mobile$user: {
$entity: 'mobile',
data: {
id: 1,
mobile: 1,
userId: 1,
},
},
userRole$user: {
$entity: 'userRole',
data: {
id: 1,
userId: 1,
roleId: 1,
},
},
},
player: {
id: 1,

View File

@ -23,6 +23,7 @@ var userProjection = {
extra1: 1,
type: 1,
entity: 1,
entityId: 1,
extension: 1,
},
filter: {

View File

@ -243,32 +243,74 @@ async function setupMobile<ED extends EntityDict, Cxt extends BackendRuntimeCont
}
async function loadTokenInfo<ED extends EntityDict, Cxt extends BackendRuntimeContext<ED>>(tokenId: string, context: Cxt ) {
await context.select('token', {
data: {
id: 1,
userId: 1,
ableState: 1,
user: {
await context.select(
'token',
{
data: {
id: 1,
name: 1,
nickname: 1,
},
player: {
id: 1,
userRole$user: {
$entity: 'userRole',
data: {
id: 1,
userId: 1,
roleId: 1,
userId: 1,
ableState: 1,
user: {
id: 1,
nickname: 1,
name: 1,
userState: 1,
extraFile$entity: {
$entity: 'extraFile',
data: {
id: 1,
tag1: 1,
origin: 1,
bucket: 1,
objectId: 1,
filename: 1,
extra1: 1,
type: 1,
entity: 1,
entityId: 1,
extension: 1,
},
filter: {
tag1: 'avatar',
},
indexFrom: 0,
count: 1,
},
mobile$user: {
$entity: 'mobile',
data: {
id: 1,
mobile: 1,
userId: 1,
},
},
userRole$user: {
$entity: 'userRole',
data: {
id: 1,
userId: 1,
roleId: 1,
},
},
},
player: {
id: 1,
userRole$user: {
$entity: 'userRole',
data: {
id: 1,
userId: 1,
roleId: 1,
},
},
},
},
filter: {
id: tokenId,
},
},
filter: {
id: tokenId,
},
}, {});
{}
);
}
export async function loginByMobile<ED extends EntityDict, Cxt extends BackendRuntimeContext<ED>>(

View File

@ -29,6 +29,7 @@ const userProjection: EntityDict['user']['Selection']['data'] = {
extra1: 1,
type: 1,
entity: 1,
entityId: 1,
extension: 1,
},
filter: {