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
1
Merge Requests
1
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
aaffb6b7
Commit
aaffb6b7
authored
Jul 15, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
776656bb
31fc52a0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
8 deletions
+28
-8
EnterpriseController.java
...ic/haoban/manage/web/controller/EnterpriseController.java
+9
-2
LoginController.java
...com/gic/haoban/manage/web/controller/LoginController.java
+19
-6
No files found.
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/controller/EnterpriseController.java
View file @
aaffb6b7
...
...
@@ -395,15 +395,22 @@ public class EnterpriseController extends WebBaseController {
* @param wxEnterpriseId 企业微信id
*/
@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"
);
logger
.
info
(
"好办运维login,host={},gicEnterpriseId={},wxEnterpriseId={}"
,
host
,
gicEnterpriseId
,
wxEnterpriseId
);
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isAnyBlank
(
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
();
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
);
return
this
.
success
(
null
)
;
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/LoginController.java
View file @
aaffb6b7
...
...
@@ -181,7 +181,7 @@ public class LoginController extends WebBaseController {
}
}
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
))
{
try
{
response
.
sendRedirect
(
host
+
"/haoban-3/#/gic-error?errorCode="
+
code
);
...
...
@@ -200,7 +200,7 @@ public class LoginController extends WebBaseController {
@IgnoreLogin
@RequestMapping
(
"yw-login"
)
public
HaobanResponse
ywLogin
(
String
wxEnterpriseId
,
String
gicEnterpriseId
,
String
random
,
HttpServletResponse
response
)
{
HttpServletResponse
response
,
String
operationUserId
,
String
userName
)
{
// 判断是否存在random
Object
o
=
RedisUtil
.
getCache
(
random
);
if
(
o
==
null
)
{
...
...
@@ -214,7 +214,8 @@ public class LoginController extends WebBaseController {
if
(
StringUtils
.
isBlank
(
gicSuperPhone
))
{
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
))
{
return
this
.
fail
(
this
.
errMessage
(
code
));
}
...
...
@@ -275,7 +276,12 @@ public class LoginController extends WebBaseController {
new
RedirectView
(
"/haoban-3/#/gic-error?errorCode=1001"
,
false
,
false
));
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
))
{
ModelAndView
model
=
new
ModelAndView
(
new
RedirectView
(
"/haoban-3/#/gic-error?errorCode="
+
errorCode
,
false
,
false
));
...
...
@@ -311,7 +317,8 @@ public class LoginController extends WebBaseController {
// 登录逻辑
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
);
WxApplicationDTO
application
=
wxApplicationApiService
.
selectByWxEnterpriseIdAndApplicationType
(
wxEnterpriseId
,
2
);
if
(
null
==
application
)
{
...
...
@@ -365,6 +372,9 @@ public class LoginController extends WebBaseController {
webLoginDTO
.
setBrandName
(
en
.
getBrandName
());
webLoginDTO
.
setSuperAdmin
(
clerk
.
getSuperAdmin
());
webLoginDTO
.
setDepartAuth
(
clerk
.
getDepartAuth
());
//运维登录信息
webLoginDTO
.
setOperationUserId
(
operationUserId
);
webLoginDTO
.
setOperationUserName
(
userName
);
String
redirectUri
=
config
.
getHost
()
+
"index"
;
redirectUri
=
redirectUri
.
replace
(
"haoban-manage3-web"
,
"haoban-3/#"
);
String
token
=
ToolUtil
.
randomUUID
()
+
"-"
+
ToolUtil
.
randomStringByTime
();
...
...
@@ -556,7 +566,7 @@ public class LoginController extends WebBaseController {
*/
@RequestMapping
(
"/gic-login-check"
)
@IgnoreLogin
public
ModelAndView
gicLogin
(
String
code
,
String
hbEnt
,
String
hbPage
)
{
public
ModelAndView
gicLogin
(
String
code
,
String
hbEnt
,
String
hbPage
,
String
operationUserId
,
String
userName
)
{
logger
.
info
(
"gic登录clerkId={},hbEnt={}"
,
code
,
hbEnt
);
PowerClerkDTO
clerkDTO
=
this
.
userService
.
haobanLoginBack
(
code
);
if
(
clerkDTO
==
null
)
{
...
...
@@ -572,6 +582,9 @@ public class LoginController extends WebBaseController {
retMap
.
put
(
"enterpriseId"
,
gicEnterpriseId
);
retMap
.
put
(
"phoneNumber"
,
loginPhoneNumber
);
retMap
.
put
(
"timestamp"
,
System
.
currentTimeMillis
()+
""
)
;
//运维登录信息
retMap
.
put
(
"operationUserId"
,
operationUserId
)
;
retMap
.
put
(
"userName"
,
userName
)
;
String
ret
=
JSONObject
.
toJSONString
(
retMap
);
AES
aes
=
SecureUtil
.
aes
(
LOGIN_KEY
.
getBytes
());
String
random
=
aes
.
encryptHex
(
ret
);
...
...
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