明树Git Lab
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
J
jt_backend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zengfanpei
jt_backend
Commits
5eb6d71d
Commit
5eb6d71d
authored
Dec 01, 2025
by
zhangqi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userinfo add include
parent
eb45c129
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
userController.js
controller/userController.js
+18
-6
No files found.
controller/userController.js
View file @
5eb6d71d
...
@@ -140,12 +140,24 @@ async function getUserInfo(req, res, next) {
...
@@ -140,12 +140,24 @@ async function getUserInfo(req, res, next) {
where
:
query
,
where
:
query
,
// raw: true,
// raw: true,
attributes
:
{
exclude
:
[
'password'
,
'salt'
]
},
attributes
:
{
exclude
:
[
'password'
,
'salt'
]
},
include
:
[{
include
:
[
{
model
:
DB
.
Role
,
model
:
DB
.
Role
,
as
:
'roles'
,
as
:
'roles'
,
// where: { del: 0 },
// where: { del: 0 },
// attributes: ['id']
// attributes: ['id']
}]
},{
model
:
DB
.
Depart
,
as
:
'departs'
,
// attributes: ["id"],
// through: { attributes: [] },
},
{
model
:
DB
.
Position
,
as
:
'positions'
,
// attributes: ["id"],
// through: { attributes: [] },
}
]
});
});
return
res
.
sendData
(
ret
);
return
res
.
sendData
(
ret
);
}
catch
(
error
)
{
}
catch
(
error
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment