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
c539f827
Commit
c539f827
authored
May 25, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/developer' into developer
parents
eb1e668d
0fa48cb1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
4 deletions
+28
-4
LoginController.java
...com/gic/haoban/manage/web/controller/LoginController.java
+28
-4
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/LoginController.java
View file @
c539f827
...
...
@@ -3,6 +3,7 @@ package com.gic.haoban.manage.web.controller;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.net.URLEncoder
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -185,8 +186,22 @@ public class LoginController extends WebBaseController {
return
model
;
}
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
o
);
logger
.
info
(
"登录信息={}"
,
jsonObject
.
toString
());
String
gicEnterpriseId
=
jsonObject
.
getString
(
"enterpriseId"
);
String
loginPhoneNumber
=
jsonObject
.
getString
(
"phoneNumber"
);
Long
timestamp
=
jsonObject
.
getLong
(
"timestamp"
)
;
if
(
null
==
timestamp
||
StringUtils
.
isAnyBlank
(
gicEnterpriseId
,
loginPhoneNumber
))
{
logger
.
info
(
"timestamp is null,gicEnterpriseId={},loginPhoneNumber={}"
,
gicEnterpriseId
,
loginPhoneNumber
);
ModelAndView
model
=
new
ModelAndView
(
new
RedirectView
(
"/haoban-3/#/gic-error?errorCode=1000"
,
false
,
false
));
return
model
;
}
if
(
timestamp
+
1000
*
60
*
5
<
System
.
currentTimeMillis
())
{
logger
.
info
(
"登录超时gicEnterpriseId={},loginPhoneNumber={}"
,
gicEnterpriseId
,
loginPhoneNumber
);
ModelAndView
model
=
new
ModelAndView
(
new
RedirectView
(
"/haoban-3/#/gic-error?errorCode=1005"
,
false
,
false
));
return
model
;
}
List
<
WxEnterpriseDTO
>
wxEnterpriseList
=
wxEnterpriseRelatedApiService
.
listWxEnterpriseByEid
(
gicEnterpriseId
,
loginPhoneNumber
);
if
(
CollectionUtils
.
isEmpty
(
wxEnterpriseList
))
{
...
...
@@ -217,12 +232,20 @@ public class LoginController extends WebBaseController {
*/
@RequestMapping
(
"get-login-qrcode"
)
@Deprecated
public
HaobanResponse
getLoginQrcode
()
throws
UnsupportedEncodingException
{
String
corpid
=
config
.
getCorpid
();
public
HaobanResponse
getLoginQrcode
(
HttpServletResponse
response
)
throws
UnsupportedEncodingException
{
/*
String corpid = config.getCorpid();
String redirectUri = config.getHost() + "login";
String url = "https://open.work.weixin.qq.com/wwopen/sso/3rd_qrConnect?appid=" + corpid + "&redirect_uri="
+
URLEncoder
.
encode
(
redirectUri
,
"UTF-8"
)
+
"&state=web_login@gyoss9&usertype=admin"
;
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
URL
.
decode
(
url
));
+ URLEncoder.encode(redirectUri, "UTF-8") + "&state=web_login@gyoss9&usertype=admin";*/
// return resultResponse(HaoBanErrCode.ERR_1, URL.decode(url));
String
gicHost
=
GlobalVar
.
ctxPropertiesMap
.
get
(
"gicweb_service_host"
);
gicHost
=
gicHost
.
replace
(
"gicweb"
,
""
).
replace
(
"https://"
,
"http://"
).
replace
(
"http://"
,
"https://"
)+
"gic-web/#/login?ishb=1"
;
try
{
response
.
sendRedirect
(
gicHost
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
null
;
}
// 登录逻辑
...
...
@@ -467,6 +490,7 @@ public class LoginController extends WebBaseController {
retMap
.
put
(
"wxEnterpriseId"
,
hbEnt
);
retMap
.
put
(
"enterpriseId"
,
gicEnterpriseId
);
retMap
.
put
(
"phoneNumber"
,
loginPhoneNumber
);
retMap
.
put
(
"timestamp"
,
System
.
currentTimeMillis
()+
""
)
;
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