Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
f759fbae
Commit
f759fbae
authored
May 21, 2017
by
fsn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决新建用户不能修改自己资料的bug
parent
174e7cfb
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
src/main/java/com/stylefeng/guns/modular/system/controller/UserMgrController.java
+4
-6
No files found.
src/main/java/com/stylefeng/guns/modular/system/controller/UserMgrController.java
View file @
f759fbae
...
@@ -10,6 +10,8 @@ import com.stylefeng.guns.common.constant.tips.Tip;
...
@@ -10,6 +10,8 @@ import com.stylefeng.guns.common.constant.tips.Tip;
import
com.stylefeng.guns.common.controller.BaseController
;
import
com.stylefeng.guns.common.controller.BaseController
;
import
com.stylefeng.guns.common.exception.BizExceptionEnum
;
import
com.stylefeng.guns.common.exception.BizExceptionEnum
;
import
com.stylefeng.guns.common.exception.BussinessException
;
import
com.stylefeng.guns.common.exception.BussinessException
;
import
com.stylefeng.guns.common.persistence.dao.UserMapper
;
import
com.stylefeng.guns.common.persistence.model.User
;
import
com.stylefeng.guns.core.db.Db
;
import
com.stylefeng.guns.core.db.Db
;
import
com.stylefeng.guns.core.listener.ConfigListener
;
import
com.stylefeng.guns.core.listener.ConfigListener
;
import
com.stylefeng.guns.core.log.LogObjectHolder
;
import
com.stylefeng.guns.core.log.LogObjectHolder
;
...
@@ -20,9 +22,6 @@ import com.stylefeng.guns.modular.system.dao.UserMgrDao;
...
@@ -20,9 +22,6 @@ import com.stylefeng.guns.modular.system.dao.UserMgrDao;
import
com.stylefeng.guns.modular.system.factory.UserFactory
;
import
com.stylefeng.guns.modular.system.factory.UserFactory
;
import
com.stylefeng.guns.modular.system.transfer.UserDto
;
import
com.stylefeng.guns.modular.system.transfer.UserDto
;
import
com.stylefeng.guns.modular.system.warpper.UserWarpper
;
import
com.stylefeng.guns.modular.system.warpper.UserWarpper
;
import
com.stylefeng.guns.common.persistence.dao.UserMapper
;
import
com.stylefeng.guns.common.persistence.model.User
;
import
org.apache.shiro.authc.AuthenticationException
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.ui.Model
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.BindingResult
;
...
@@ -193,7 +192,6 @@ public class UserMgrController extends BaseController {
...
@@ -193,7 +192,6 @@ public class UserMgrController extends BaseController {
*/
*/
@RequestMapping
(
"/edit"
)
@RequestMapping
(
"/edit"
)
@BussinessLog
(
value
=
"修改管理员"
,
key
=
"account"
,
dict
=
Dict
.
UserDict
)
@BussinessLog
(
value
=
"修改管理员"
,
key
=
"account"
,
dict
=
Dict
.
UserDict
)
@Permission
(
Const
.
ADMIN_NAME
)
@ResponseBody
@ResponseBody
public
Tip
edit
(
@Valid
UserDto
user
,
BindingResult
result
)
throws
NoPermissionException
{
public
Tip
edit
(
@Valid
UserDto
user
,
BindingResult
result
)
throws
NoPermissionException
{
if
(
result
.
hasErrors
())
{
if
(
result
.
hasErrors
())
{
...
@@ -204,11 +202,11 @@ public class UserMgrController extends BaseController {
...
@@ -204,11 +202,11 @@ public class UserMgrController extends BaseController {
return
SUCCESS_TIP
;
return
SUCCESS_TIP
;
}
else
{
}
else
{
ShiroUser
shiroUser
=
ShiroKit
.
getUser
();
ShiroUser
shiroUser
=
ShiroKit
.
getUser
();
if
(
shiroUser
.
getId
()
==
user
.
getId
(
))
{
if
(
shiroUser
.
getId
()
.
equals
(
user
.
getId
()
))
{
this
.
userMapper
.
updateById
(
UserFactory
.
createUser
(
user
));
this
.
userMapper
.
updateById
(
UserFactory
.
createUser
(
user
));
return
SUCCESS_TIP
;
return
SUCCESS_TIP
;
}
else
{
}
else
{
throw
new
AuthenticationException
(
);
throw
new
BussinessException
(
BizExceptionEnum
.
NO_PERMITION
);
}
}
}
}
}
}
...
...
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