Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Litemall
Commits
88c5a81e
Commit
88c5a81e
authored
Nov 27, 2018
by
Junling Bu
Browse files
chore[litemall-admin-api]: 禁止超级管理员修改密码,防止演示平台不能访问。
parent
1bb77d66
Changes
1
Hide whitespace changes
Inline
Side-by-side
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminProfileController.java
View file @
88c5a81e
...
...
@@ -16,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
static
org
.
linlinjava
.
litemall
.
admin
.
util
.
AdminResponseCode
.
ADMIN_ALTER_NOT_ALLOWED
;
import
static
org
.
linlinjava
.
litemall
.
admin
.
util
.
AdminResponseCode
.
ADMIN_INVALID_ACCOUNT
;
@RestController
...
...
@@ -33,6 +34,12 @@ public class AdminProfileController {
return
ResponseUtil
.
unlogin
();
}
// TODO 这里开发者需要删除以下检验代码
// 目前这里不允许修改超级管理员是防止演示平台上他人修改管理员密码而导致登录失败
if
(
adminId
==
1
)
{
return
ResponseUtil
.
fail
(
ADMIN_ALTER_NOT_ALLOWED
,
"超级管理员不能修改"
);
}
String
oldPassword
=
JacksonUtil
.
parseString
(
body
,
"oldPassword"
);
String
newPassword
=
JacksonUtil
.
parseString
(
body
,
"newPassword"
);
if
(
StringUtils
.
isEmpty
(
oldPassword
))
{
...
...
Write
Preview
Supports
Markdown
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