明树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
aa087116
Commit
aa087116
authored
Jan 12, 2026
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2
parent
b3538b68
Pipeline
#105977
passed with stage
in 3 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
6 deletions
+6
-6
resourceController.js
controller/resourceController.js
+2
-2
roleController.js
controller/roleController.js
+1
-1
userController.js
controller/userController.js
+3
-3
No files found.
controller/resourceController.js
View file @
aa087116
...
...
@@ -49,7 +49,7 @@ async function updateResource(req, res, next) {
if
(
!
(
ress
&&
ress
.
id
))
{
return
res
.
sendError
(
errorMessage
.
resourceNotFound
)
}
await
DB
.
ResourcesInfo
.
dest
or
y
({
where
:
{
resourceId
:
ress
.
id
}
});
await
DB
.
ResourcesInfo
.
dest
ro
y
({
where
:
{
resourceId
:
ress
.
id
}
});
if
(
req
.
body
.
type
==
1
)
{
let
ris
=
[];
for
(
let
index
=
0
;
index
<
req
.
body
.
resourceInfos
.
length
;
index
++
)
{
...
...
@@ -230,7 +230,7 @@ async function saveAllResourceInfo(req, res, next) {
}
}
if
(
toKeep
.
length
)
{
await
DB
.
ResourcesInfo
.
dest
or
y
({
await
DB
.
ResourcesInfo
.
dest
ro
y
({
where
:
{
[
Op
.
nin
]:
toKeep
}
})
}
...
...
controller/roleController.js
View file @
aa087116
...
...
@@ -65,7 +65,7 @@ async function deleteRole(req, res, next) {
// }
const
ret
=
await
DB
.
Role
.
update
({
del
:
1
},
{
where
:
{
id
:
req
.
body
.
id
}
});
//删除用户角色绑定
await
DB
.
UserRole
.
dest
or
y
({
where
:
{
roleId
:
req
.
body
.
id
}});
await
DB
.
UserRole
.
dest
ro
y
({
where
:
{
roleId
:
req
.
body
.
id
}});
return
res
.
sendData
(
ret
);
}
catch
(
error
)
{
next
(
error
);
...
...
controller/userController.js
View file @
aa087116
...
...
@@ -343,11 +343,11 @@ async function deleteUser(req, res, next) {
}
const
ret
=
await
DB
.
User
.
update
({
del
:
1
},
{
where
:
search
});
//删除标记
//删除用户与角色绑定
await
DB
.
UserRole
.
dest
or
y
({
where
:
{
userId
:
req
.
body
.
id
}});
await
DB
.
UserRole
.
dest
ro
y
({
where
:
{
userId
:
req
.
body
.
id
}});
//删除用户与部门绑定
await
DB
.
UserDepart
.
dest
or
y
({
where
:
{
userId
:
req
.
body
.
id
}});
await
DB
.
UserDepart
.
dest
ro
y
({
where
:
{
userId
:
req
.
body
.
id
}});
//删除用户与岗位绑定
await
DB
.
UserPosition
.
dest
or
y
({
where
:
{
userId
:
req
.
body
.
id
}});
await
DB
.
UserPosition
.
dest
ro
y
({
where
:
{
userId
:
req
.
body
.
id
}});
return
res
.
sendData
(
ret
);
}
catch
(
error
)
{
next
(
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