明树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
1e1e2fdd
Commit
1e1e2fdd
authored
Mar 11, 2026
by
zfp1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
14a5acc9
Pipeline
#108216
passed with stage
in 3 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
roleController.js
controller/roleController.js
+1
-1
userController.js
controller/userController.js
+4
-3
No files found.
controller/roleController.js
View file @
1e1e2fdd
...
...
@@ -48,7 +48,7 @@ async function updateRole(req, res, next) {
}
// sequelize 只有update 写时需要注意条件 不能为空
if
(
role
.
key
!=
req
.
body
.
key
)
{
let
rt
=
await
DB
.
Role
.
findOne
({
where
:
{
key
:
req
.
body
.
key
}});
let
rt
=
await
DB
.
Role
.
findOne
({
where
:
{
key
:
req
.
body
.
key
,
del
:
0
}});
if
(
rt
)
{
return
res
.
sendError
(
errorMessage
.
roleDuplicate
);
}
...
...
controller/userController.js
View file @
1e1e2fdd
...
...
@@ -161,11 +161,12 @@ async function createUser(req, res, next) {
body
.
password
=
passwordHash
;
const
checkMobile
=
await
DB
.
User
.
findOne
({
where
:
{
mobile
:
body
.
mobile
mobile
:
body
.
mobile
,
del
:
0
}
});
if
(
checkMobile
)
{
return
res
.
sendError
(
errorMessage
.
nameDuplicated
)
return
res
.
sendError
(
errorMessage
.
mobileDuplicate
)
}
const
ret
=
await
DB
.
User
.
create
(
body
);
if
(
!
(
ret
&&
ret
.
id
))
{
...
...
@@ -281,7 +282,7 @@ async function updateUser(req, res, next) {
}
//
if
(
user
.
mobile
!=
req
.
body
.
mobile
)
{
let
mt
=
await
DB
.
User
.
findOne
({
where
:
{
mobile
:
req
.
body
.
mobile
}});
let
mt
=
await
DB
.
User
.
findOne
({
where
:
{
mobile
:
req
.
body
.
mobile
,
del
:
0
}});
if
(
mt
)
{
return
res
.
sendError
(
errorMessage
.
mobileDuplicate
)
}
...
...
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