Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
saasio
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
reyun
saasio
Commits
270462d7
Commit
270462d7
authored
Mar 19, 2018
by
songweifeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ceshi
parent
08b12045
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
2 deletions
+61
-2
LoginController.java
src/main/java/com/reyun/controller/LoginController.java
+61
-2
No files found.
src/main/java/com/reyun/controller/LoginController.java
View file @
270462d7
...
...
@@ -100,13 +100,73 @@ public class LoginController
}
}
if
(!
account
.
getIsSuperUser
())
{
String
nowDate
=
DateUtil
.
format
(
new
Date
(),
DateUtil
.
C_DATE_PATTON_DEFAULT
);
if
(
account
.
getIsSuperUser
())
{
//母账号
if
(
account
.
getStatus
()
==
0
)
{
//主账号禁用
rtnMap
.
put
(
"msg"
,
"主账号禁用"
);
rtnMap
.
put
(
"code"
,
208
);
return
ResultModel
.
OK
(
rtnMap
);
}
else
if
(
account
.
getStatus
()
==
-
1
)
{
//主账号还没通过审核
rtnMap
.
put
(
"msg"
,
"还没通过审核"
);
rtnMap
.
put
(
"code"
,
210
);
return
ResultModel
.
OK
(
rtnMap
);
}
else
if
(
account
.
getStatus
()
==
-
2
)
{
//主账号还没通过审核
rtnMap
.
put
(
"msg"
,
"还没通过审核"
);
rtnMap
.
put
(
"code"
,
210
);
return
ResultModel
.
OK
(
rtnMap
);
}
//主账号过期
if
(!
StringUtil
.
isEmpty
(
account
.
getPastDate
())
&&
DateUtil
.
compare_date
(
nowDate
,
account
.
getPastDate
())
==
1
)
{
rtnMap
.
put
(
"msg"
,
"主账号过期"
);
rtnMap
.
put
(
"code"
,
206
);
return
ResultModel
.
OK
(
rtnMap
);
}
}
else
{
//子账号
if
(
account
.
getStatus
()
==
0
)
{
// 子账号禁用
rtnMap
.
put
(
"msg"
,
"子账号禁用"
);
rtnMap
.
put
(
"code"
,
203
);
return
ResultModel
.
OK
(
rtnMap
);
}
else
if
(!
account
.
getRoleCategory
().
equals
(
5L
)){
//获取根节点母账号
Account
parent
=
authService
.
findRootParentAccount
(
account
.
getId
());
if
(
parent
.
getStatus
()
==
0
)
{
//子账号所在主账号被禁用
rtnMap
.
put
(
"msg"
,
"子账号所在主账号被禁用"
);
rtnMap
.
put
(
"code"
,
209
);
return
ResultModel
.
OK
(
rtnMap
);
}
else
if
(!
StringUtil
.
isEmpty
(
parent
.
getPastDate
())
&&
DateUtil
.
compare_date
(
nowDate
,
parent
.
getPastDate
())
==
1
)
{
//子账号所在主账号过期
rtnMap
.
put
(
"msg"
,
"子账号所在主账号过期"
);
rtnMap
.
put
(
"code"
,
207
);
return
ResultModel
.
OK
(
rtnMap
);
}
}
//没有控制权限AuthStr没有授权
if
(!
account
.
getRoleCategory
().
equals
(
RoleEnumType
.
MANAGER
.
getKey
()))
{
if
(!
ValidateUtil
.
isValid
(
account
.
getAuthStr
())
||
!
ValidateUtil
.
isValid
(
JSONObject
.
fromObject
(
account
.
getAuthStr
())))
{
rtnMap
.
put
(
"msg"
,
"没有产品权限"
);
rtnMap
.
put
(
"code"
,
202
);
return
ResultModel
.
OK
(
rtnMap
);
}
}
}
...
...
@@ -144,7 +204,6 @@ public class LoginController
catch
(
Exception
e
)
{
logger
.
error
(
"fail to parse ip,"
+
e
.
getMessage
());
}
return
ResultModel
.
OK
(
rtnMap
);
}
else
{
...
...
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