Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
haoban3.0
haoban-manage3.0
Commits
78b12401
Commit
78b12401
authored
Jul 15, 2022
by
guojx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
运维登录相关信息。新版运维登录、运维登录GIC再登录好办
parent
3bb0f553
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
7 deletions
+24
-7
EnterpriseController.java
...ic/haoban/manage/web/controller/EnterpriseController.java
+9
-2
LoginController.java
...com/gic/haoban/manage/web/controller/LoginController.java
+15
-5
No files found.
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/controller/EnterpriseController.java
View file @
78b12401
...
@@ -395,15 +395,22 @@ public class EnterpriseController extends WebBaseController {
...
@@ -395,15 +395,22 @@ public class EnterpriseController extends WebBaseController {
* @param wxEnterpriseId 企业微信id
* @param wxEnterpriseId 企业微信id
*/
*/
@RequestMapping
(
"yw-login"
)
@RequestMapping
(
"yw-login"
)
public
HaobanResponse
ywLogin
(
String
wxEnterpriseId
,
String
gicEnterpriseId
,
HttpServletResponse
httpServletResponse
)
throws
IOException
{
public
HaobanResponse
ywLogin
(
String
wxEnterpriseId
,
String
gicEnterpriseId
,
HttpServletResponse
httpServletResponse
,
HttpServletRequest
request
)
throws
IOException
{
String
host
=
GlobalVar
.
ctxPropertiesMap
.
get
(
"haoban_service_host"
);
String
host
=
GlobalVar
.
ctxPropertiesMap
.
get
(
"haoban_service_host"
);
logger
.
info
(
"好办运维login,host={},gicEnterpriseId={},wxEnterpriseId={}"
,
host
,
gicEnterpriseId
,
wxEnterpriseId
);
logger
.
info
(
"好办运维login,host={},gicEnterpriseId={},wxEnterpriseId={}"
,
host
,
gicEnterpriseId
,
wxEnterpriseId
);
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isAnyBlank
(
wxEnterpriseId
,
gicEnterpriseId
))
{
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isAnyBlank
(
wxEnterpriseId
,
gicEnterpriseId
))
{
return
this
.
fail
(
"wxEnterpriseId和gicEnterpriseId都不能为空"
)
;
return
this
.
fail
(
"wxEnterpriseId和gicEnterpriseId都不能为空"
)
;
}
}
AuthcenterUserDetails
loginUser
=
(
AuthcenterUserDetails
)
SessionContextUtil
.
getUser
(
request
)
;
String
operationUserId
=
String
.
valueOf
(
loginUser
.
getId
());
//运维信息参数
String
operationInfo
=
"&operationUserId="
+
operationUserId
+
"&userName="
+
loginUser
.
getRealName
();
String
random
=
"ywLogin:"
+
UuidUtil
.
randomUUID
();
String
random
=
"ywLogin:"
+
UuidUtil
.
randomUUID
();
RedisUtil
.
setCache
(
random
,
1
,
10L
);
RedisUtil
.
setCache
(
random
,
1
,
10L
);
String
url
=
host
+
LOGIN_URL
+
"?gicEnterpriseId="
+
gicEnterpriseId
+
"&wxEnterpriseId="
+
wxEnterpriseId
+
"&random="
+
random
;
String
url
=
host
+
LOGIN_URL
+
"?gicEnterpriseId="
+
gicEnterpriseId
+
"&wxEnterpriseId="
+
wxEnterpriseId
+
"&random="
+
random
+
operationInfo
;
httpServletResponse
.
sendRedirect
(
url
);
httpServletResponse
.
sendRedirect
(
url
);
return
this
.
success
(
null
)
;
return
this
.
success
(
null
)
;
}
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/LoginController.java
View file @
78b12401
...
@@ -181,7 +181,7 @@ public class LoginController extends WebBaseController {
...
@@ -181,7 +181,7 @@ public class LoginController extends WebBaseController {
}
}
}
}
logger
.
info
(
"登录商户={}"
,
gicEnterpriseId
);
logger
.
info
(
"登录商户={}"
,
gicEnterpriseId
);
String
code
=
this
.
doLogin
(
wxEnterpriseId
,
gicEnterpriseId
,
loginPhoneNumber
,
"gic"
,
response
);
String
code
=
this
.
doLogin
(
wxEnterpriseId
,
gicEnterpriseId
,
loginPhoneNumber
,
"gic"
,
response
,
null
,
null
);
if
(
StringUtils
.
isNotBlank
(
code
))
{
if
(
StringUtils
.
isNotBlank
(
code
))
{
try
{
try
{
response
.
sendRedirect
(
host
+
"/haoban-3/#/gic-error?errorCode="
+
code
);
response
.
sendRedirect
(
host
+
"/haoban-3/#/gic-error?errorCode="
+
code
);
...
@@ -200,7 +200,7 @@ public class LoginController extends WebBaseController {
...
@@ -200,7 +200,7 @@ public class LoginController extends WebBaseController {
@IgnoreLogin
@IgnoreLogin
@RequestMapping
(
"yw-login"
)
@RequestMapping
(
"yw-login"
)
public
HaobanResponse
ywLogin
(
String
wxEnterpriseId
,
String
gicEnterpriseId
,
String
random
,
public
HaobanResponse
ywLogin
(
String
wxEnterpriseId
,
String
gicEnterpriseId
,
String
random
,
HttpServletResponse
response
)
{
HttpServletResponse
response
,
String
operationUserId
,
String
userName
)
{
// 判断是否存在random
// 判断是否存在random
Object
o
=
RedisUtil
.
getCache
(
random
);
Object
o
=
RedisUtil
.
getCache
(
random
);
if
(
o
==
null
)
{
if
(
o
==
null
)
{
...
@@ -214,7 +214,8 @@ public class LoginController extends WebBaseController {
...
@@ -214,7 +214,8 @@ public class LoginController extends WebBaseController {
if
(
StringUtils
.
isBlank
(
gicSuperPhone
))
{
if
(
StringUtils
.
isBlank
(
gicSuperPhone
))
{
return
this
.
fail
(
"商户超管的手机号未配置"
);
return
this
.
fail
(
"商户超管的手机号未配置"
);
}
}
String
code
=
this
.
doLogin
(
wxEnterpriseId
,
gicEnterpriseId
,
gicSuperPhone
,
"yw"
,
response
);
//运维单点登录信息:operationUserId userName : 运维realName
String
code
=
this
.
doLogin
(
wxEnterpriseId
,
gicEnterpriseId
,
gicSuperPhone
,
"yw"
,
response
,
operationUserId
,
userName
);
if
(
StringUtils
.
isNotBlank
(
code
))
{
if
(
StringUtils
.
isNotBlank
(
code
))
{
return
this
.
fail
(
this
.
errMessage
(
code
));
return
this
.
fail
(
this
.
errMessage
(
code
));
}
}
...
@@ -275,7 +276,12 @@ public class LoginController extends WebBaseController {
...
@@ -275,7 +276,12 @@ public class LoginController extends WebBaseController {
new
RedirectView
(
"/haoban-3/#/gic-error?errorCode=1001"
,
false
,
false
));
new
RedirectView
(
"/haoban-3/#/gic-error?errorCode=1001"
,
false
,
false
));
return
model
;
return
model
;
}
}
String
errorCode
=
this
.
doLogin
(
wxEnterpriseId
,
gicEnterpriseId
,
loginPhoneNumber
,
"gic"
,
response
);
//运维登录信息
String
operationUserId
=
jsonObject
.
getString
(
"operationUserId"
);
String
userName
=
jsonObject
.
getString
(
"userName"
);
String
errorCode
=
this
.
doLogin
(
wxEnterpriseId
,
gicEnterpriseId
,
loginPhoneNumber
,
"gic"
,
response
,
operationUserId
,
userName
);
if
(
StringUtils
.
isNotBlank
(
errorCode
))
{
if
(
StringUtils
.
isNotBlank
(
errorCode
))
{
ModelAndView
model
=
new
ModelAndView
(
ModelAndView
model
=
new
ModelAndView
(
new
RedirectView
(
"/haoban-3/#/gic-error?errorCode="
+
errorCode
,
false
,
false
));
new
RedirectView
(
"/haoban-3/#/gic-error?errorCode="
+
errorCode
,
false
,
false
));
...
@@ -311,7 +317,8 @@ public class LoginController extends WebBaseController {
...
@@ -311,7 +317,8 @@ public class LoginController extends WebBaseController {
// 登录逻辑
// 登录逻辑
private
String
doLogin
(
String
wxEnterpriseId
,
String
gicEnterpriseId
,
String
loginPhoneNumber
,
String
loginChannel
,
private
String
doLogin
(
String
wxEnterpriseId
,
String
gicEnterpriseId
,
String
loginPhoneNumber
,
String
loginChannel
,
HttpServletResponse
response
)
{
HttpServletResponse
response
,
String
operationUserId
,
String
userName
)
{
//运维单点登录信息:operationUserId userName : 运维realName
logger
.
info
(
"doLogin={},{}"
,
gicEnterpriseId
,
loginPhoneNumber
);
logger
.
info
(
"doLogin={},{}"
,
gicEnterpriseId
,
loginPhoneNumber
);
WxApplicationDTO
application
=
wxApplicationApiService
.
selectByWxEnterpriseIdAndApplicationType
(
wxEnterpriseId
,
2
);
WxApplicationDTO
application
=
wxApplicationApiService
.
selectByWxEnterpriseIdAndApplicationType
(
wxEnterpriseId
,
2
);
if
(
null
==
application
)
{
if
(
null
==
application
)
{
...
@@ -365,6 +372,9 @@ public class LoginController extends WebBaseController {
...
@@ -365,6 +372,9 @@ public class LoginController extends WebBaseController {
webLoginDTO
.
setBrandName
(
en
.
getBrandName
());
webLoginDTO
.
setBrandName
(
en
.
getBrandName
());
webLoginDTO
.
setSuperAdmin
(
clerk
.
getSuperAdmin
());
webLoginDTO
.
setSuperAdmin
(
clerk
.
getSuperAdmin
());
webLoginDTO
.
setDepartAuth
(
clerk
.
getDepartAuth
());
webLoginDTO
.
setDepartAuth
(
clerk
.
getDepartAuth
());
//运维登录信息
webLoginDTO
.
setOperationUserId
(
operationUserId
);
webLoginDTO
.
setOperationUserName
(
userName
);
String
redirectUri
=
config
.
getHost
()
+
"index"
;
String
redirectUri
=
config
.
getHost
()
+
"index"
;
redirectUri
=
redirectUri
.
replace
(
"haoban-manage3-web"
,
"haoban-3/#"
);
redirectUri
=
redirectUri
.
replace
(
"haoban-manage3-web"
,
"haoban-3/#"
);
String
token
=
ToolUtil
.
randomUUID
()
+
"-"
+
ToolUtil
.
randomStringByTime
();
String
token
=
ToolUtil
.
randomUUID
()
+
"-"
+
ToolUtil
.
randomStringByTime
();
...
...
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