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
de2ef38d
Commit
de2ef38d
authored
Dec 02, 2018
by
Junling Bu
Browse files
chore[litemall-admin-api]: 演示相关代码删除,防止开发者没有评估引入安全问题。
parent
8a9ad3a4
Changes
3
Hide whitespace changes
Inline
Side-by-side
doc/project.md
View file @
de2ef38d
...
...
@@ -1085,7 +1085,7 @@ http://www.example.com
本项目只是参考项目,项目代码质量和功能不可能符合开发者的最终需求,
因此开发者**请务必仔细评估项目代码**。
此外,请阅读1.7.7节,了解项目当前所有的TODO事项,特别是“演示平台TODO”
。
特别提醒,上线前管理员用户名和密码请更改,不能采用这里的默认值
。
### 1.6.6 项目优化
...
...
@@ -1236,6 +1236,7 @@ application配置文件中,但是问题就是数据库信息一旦改变则其



其实原理也很简单,就是配置文件采用application-{module}-{profile}.yml来支持不同模块不同阶段的配置需求。
### 1.7.5 前后端校验
...
...
@@ -1304,16 +1305,7 @@ application配置文件中,但是问题就是数据库信息一旦改变则其
下面列出一些重要的TODO:
#### 1.7.7.1 演示平台TODO
管理后台部署以后,有开发者在演示平台修改密码,导致其他开发者不能登录演示平台。
因此在修改密码后端服务代码中加了限制代码,不允许用户修改userId=1的超级管理员密码。
因此如果开发者上线管理后台,请**务必删除**这些代码。
见`AdminProfileController`类和`AdminAdminController`类。
#### 1.7.7.2 微信退款TODO
#### 1.7.7.1 微信退款TODO
管理后台管理员点击退款按钮时,管理后台会通过微信退款API请求微信商户平台退款。
但是从安全角度考虑,**强烈建议**开发者删除微信退款代码,而登录微信商户平台手动退款。
...
...
@@ -1323,11 +1315,11 @@ application配置文件中,但是问题就是数据库信息一旦改变则其
再次提醒,本项目不承担任何使用后果。
#### 1.7.7.
3
未完善TODO
#### 1.7.7.
2
未完善TODO
有些业务只是实现基本功能,因此这里TODO提醒开发者自行思考。
#### 1.7.7.
4
重构TODO
#### 1.7.7.
3
重构TODO
有些业务需求不是很清晰,导致实现时可能存在不合理地方,这里TODO提醒
开发者审阅代码逻辑。
\ No newline at end of file
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminAdminController.java
View file @
de2ef38d
...
...
@@ -139,11 +139,6 @@ public class AdminAdminController {
if
(
anotherAdminId
==
null
)
{
return
ResponseUtil
.
badArgument
();
}
// TODO 这里开发者需要删除以下检验代码
// 目前这里不允许修改超级管理员是防止演示平台上他人修改管理员密码而导致登录失败
if
(
anotherAdminId
==
1
)
{
return
ResponseUtil
.
fail
(
ADMIN_ALTER_NOT_ALLOWED
,
"超级管理员不能修改"
);
}
String
rawPassword
=
admin
.
getPassword
();
BCryptPasswordEncoder
encoder
=
new
BCryptPasswordEncoder
();
...
...
@@ -167,11 +162,6 @@ public class AdminAdminController {
if
(
anotherAdminId
==
null
)
{
return
ResponseUtil
.
badArgument
();
}
// TODO 这里开发者需要删除以下检验代码
// 目前这里不允许删除超级管理员是防止演示平台上他人删除管理员账号而导致登录失败
if
(
anotherAdminId
==
1
)
{
return
ResponseUtil
.
fail
(
ADMIN_DELETE_NOT_ALLOWED
,
"超级管理员不能删除"
);
}
adminService
.
deleteById
(
anotherAdminId
);
return
ResponseUtil
.
ok
();
...
...
litemall-admin-api/src/main/java/org/linlinjava/litemall/admin/web/AdminProfileController.java
View file @
de2ef38d
...
...
@@ -34,12 +34,6 @@ 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