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
fa741273
Commit
fa741273
authored
Jun 03, 2017
by
fsn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户管理权限整理
parent
9202765b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
sql/guns.sql
+0
-0
src/main/java/com/stylefeng/guns/modular/system/controller/UserMgrController.java
+7
-5
No files found.
sql/guns.sql
View file @
fa741273
This diff is collapsed.
Click to expand it.
src/main/java/com/stylefeng/guns/modular/system/controller/UserMgrController.java
View file @
fa741273
...
@@ -77,6 +77,7 @@ public class UserMgrController extends BaseController {
...
@@ -77,6 +77,7 @@ public class UserMgrController extends BaseController {
/**
/**
* 跳转到角色分配页面
* 跳转到角色分配页面
*/
*/
@Permission
@RequestMapping
(
"/role_assign/{userId}"
)
@RequestMapping
(
"/role_assign/{userId}"
)
public
String
roleAssign
(
@PathVariable
Integer
userId
,
Model
model
)
{
public
String
roleAssign
(
@PathVariable
Integer
userId
,
Model
model
)
{
if
(
ToolUtil
.
isEmpty
(
userId
))
{
if
(
ToolUtil
.
isEmpty
(
userId
))
{
...
@@ -91,6 +92,7 @@ public class UserMgrController extends BaseController {
...
@@ -91,6 +92,7 @@ public class UserMgrController extends BaseController {
/**
/**
* 跳转到编辑管理员页面
* 跳转到编辑管理员页面
*/
*/
@Permission
@RequestMapping
(
"/user_edit/{userId}"
)
@RequestMapping
(
"/user_edit/{userId}"
)
public
String
userEdit
(
@PathVariable
Integer
userId
,
Model
model
)
{
public
String
userEdit
(
@PathVariable
Integer
userId
,
Model
model
)
{
if
(
ToolUtil
.
isEmpty
(
userId
))
{
if
(
ToolUtil
.
isEmpty
(
userId
))
{
...
@@ -155,6 +157,7 @@ public class UserMgrController extends BaseController {
...
@@ -155,6 +157,7 @@ public class UserMgrController extends BaseController {
* 查询管理员列表
* 查询管理员列表
*/
*/
@RequestMapping
(
"/list"
)
@RequestMapping
(
"/list"
)
@Permission
@ResponseBody
@ResponseBody
public
Object
list
(
@RequestParam
(
required
=
false
)
String
name
,
@RequestParam
(
required
=
false
)
String
beginTime
,
@RequestParam
(
required
=
false
)
String
endTime
)
{
public
Object
list
(
@RequestParam
(
required
=
false
)
String
name
,
@RequestParam
(
required
=
false
)
String
beginTime
,
@RequestParam
(
required
=
false
)
String
endTime
)
{
List
<
Map
<
String
,
Object
>>
users
=
managerDao
.
selectUsers
(
name
,
beginTime
,
endTime
);
List
<
Map
<
String
,
Object
>>
users
=
managerDao
.
selectUsers
(
name
,
beginTime
,
endTime
);
...
@@ -227,7 +230,7 @@ public class UserMgrController extends BaseController {
...
@@ -227,7 +230,7 @@ public class UserMgrController extends BaseController {
throw
new
BussinessException
(
BizExceptionEnum
.
REQUEST_NULL
);
throw
new
BussinessException
(
BizExceptionEnum
.
REQUEST_NULL
);
}
}
//不能删除超级管理员
//不能删除超级管理员
if
(
userId
.
equals
(
Const
.
ADMIN_ID
))
{
if
(
userId
.
equals
(
Const
.
ADMIN_ID
))
{
throw
new
BussinessException
(
BizExceptionEnum
.
CANT_DELETE_ADMIN
);
throw
new
BussinessException
(
BizExceptionEnum
.
CANT_DELETE_ADMIN
);
}
}
this
.
managerDao
.
setStatus
(
userId
,
ManagerStatus
.
DELETED
.
getCode
());
this
.
managerDao
.
setStatus
(
userId
,
ManagerStatus
.
DELETED
.
getCode
());
...
@@ -276,7 +279,7 @@ public class UserMgrController extends BaseController {
...
@@ -276,7 +279,7 @@ public class UserMgrController extends BaseController {
throw
new
BussinessException
(
BizExceptionEnum
.
REQUEST_NULL
);
throw
new
BussinessException
(
BizExceptionEnum
.
REQUEST_NULL
);
}
}
//不能冻结超级管理员
//不能冻结超级管理员
if
(
userId
.
equals
(
Const
.
ADMIN_ID
))
{
if
(
userId
.
equals
(
Const
.
ADMIN_ID
))
{
throw
new
BussinessException
(
BizExceptionEnum
.
CANT_FREEZE_ADMIN
);
throw
new
BussinessException
(
BizExceptionEnum
.
CANT_FREEZE_ADMIN
);
}
}
this
.
managerDao
.
setStatus
(
userId
,
ManagerStatus
.
FREEZED
.
getCode
());
this
.
managerDao
.
setStatus
(
userId
,
ManagerStatus
.
FREEZED
.
getCode
());
...
@@ -310,7 +313,7 @@ public class UserMgrController extends BaseController {
...
@@ -310,7 +313,7 @@ public class UserMgrController extends BaseController {
throw
new
BussinessException
(
BizExceptionEnum
.
REQUEST_NULL
);
throw
new
BussinessException
(
BizExceptionEnum
.
REQUEST_NULL
);
}
}
//不能修改超级管理员
//不能修改超级管理员
if
(
userId
.
equals
(
Const
.
ADMIN_ID
))
{
if
(
userId
.
equals
(
Const
.
ADMIN_ID
))
{
throw
new
BussinessException
(
BizExceptionEnum
.
CANT_CHANGE_ADMIN
);
throw
new
BussinessException
(
BizExceptionEnum
.
CANT_CHANGE_ADMIN
);
}
}
this
.
managerDao
.
setRoles
(
userId
,
roleIds
);
this
.
managerDao
.
setRoles
(
userId
,
roleIds
);
...
@@ -321,9 +324,8 @@ public class UserMgrController extends BaseController {
...
@@ -321,9 +324,8 @@ public class UserMgrController extends BaseController {
* 上传图片(上传到项目的webapp/static/img)
* 上传图片(上传到项目的webapp/static/img)
*/
*/
@RequestMapping
(
method
=
RequestMethod
.
POST
,
path
=
"/upload"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
path
=
"/upload"
)
public
@ResponseBody
@ResponseBody
String
upload
(
@RequestPart
(
"file"
)
MultipartFile
picture
)
{
public
String
upload
(
@RequestPart
(
"file"
)
MultipartFile
picture
)
{
String
pictureName
=
UUID
.
randomUUID
().
toString
()
+
".jpg"
;
String
pictureName
=
UUID
.
randomUUID
().
toString
()
+
".jpg"
;
try
{
try
{
String
fileSavePath
=
gunsProperties
.
getFileUploadPath
();
String
fileSavePath
=
gunsProperties
.
getFileUploadPath
();
...
...
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