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
aa83fd71
Commit
aa83fd71
authored
Jun 14, 2017
by
naan1993
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决没有角色不能登陆的bug
parent
ea1a9ddd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
src/main/java/com/stylefeng/guns/modular/system/controller/LoginController.java
+7
-0
No files found.
src/main/java/com/stylefeng/guns/modular/system/controller/LoginController.java
View file @
aa83fd71
...
@@ -2,6 +2,8 @@ package com.stylefeng.guns.modular.system.controller;
...
@@ -2,6 +2,8 @@ package com.stylefeng.guns.modular.system.controller;
import
com.google.code.kaptcha.Constants
;
import
com.google.code.kaptcha.Constants
;
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.BussinessException
;
import
com.stylefeng.guns.common.exception.InvalidKaptchaException
;
import
com.stylefeng.guns.common.exception.InvalidKaptchaException
;
import
com.stylefeng.guns.common.node.MenuNode
;
import
com.stylefeng.guns.common.node.MenuNode
;
import
com.stylefeng.guns.common.persistence.dao.UserMapper
;
import
com.stylefeng.guns.common.persistence.dao.UserMapper
;
...
@@ -46,6 +48,11 @@ public class LoginController extends BaseController {
...
@@ -46,6 +48,11 @@ public class LoginController extends BaseController {
public
String
index
(
Model
model
)
{
public
String
index
(
Model
model
)
{
//获取菜单列表
//获取菜单列表
List
<
Integer
>
roleList
=
ShiroKit
.
getUser
().
getRoleList
();
List
<
Integer
>
roleList
=
ShiroKit
.
getUser
().
getRoleList
();
if
(
roleList
==
null
||
roleList
.
size
()
==
0
){
ShiroKit
.
getSubject
().
logout
();
model
.
addAttribute
(
"tips"
,
"该用户没有角色,无法登陆"
);
return
"/login.html"
;
}
List
<
MenuNode
>
menus
=
menuDao
.
getMenusByRoleIds
(
roleList
);
List
<
MenuNode
>
menus
=
menuDao
.
getMenusByRoleIds
(
roleList
);
List
<
MenuNode
>
titles
=
MenuNode
.
buildTitle
(
menus
);
List
<
MenuNode
>
titles
=
MenuNode
.
buildTitle
(
menus
);
model
.
addAttribute
(
"titles"
,
titles
);
model
.
addAttribute
(
"titles"
,
titles
);
...
...
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