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
a682bb8e
Commit
a682bb8e
authored
Jun 23, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log
parent
c7f17e70
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
6 deletions
+43
-6
LoginController.java
...com/gic/haoban/manage/web/controller/LoginController.java
+43
-6
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/LoginController.java
View file @
a682bb8e
...
...
@@ -96,19 +96,37 @@ public class LoginController extends WebBaseController {
String
userJson
=
qywxCorpApiService
.
getLoginUserInfo
(
config
.
getCorpid
(),
auth_code
);
if
(
StringUtils
.
isBlank
(
userJson
))
{
logger
.
info
(
"企微登录失败auth_code={}"
,
auth_code
);
return
this
.
fail
(
"auth_code解析失败"
);
String
code
=
"1000"
;
try
{
response
.
sendRedirect
(
"/haoban-3/#/gic-error?errorCode="
+
code
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
this
.
fail
(
this
.
errMessage
(
code
));
}
UserDTO
wxUser
=
JSON
.
parseObject
(
userJson
,
UserDTO
.
class
);
logger
.
info
(
"企微登录user={}"
,
JSON
.
toJSONString
(
wxUser
));
String
corpId
=
wxUser
.
getCorpid
();
if
(
StringUtils
.
isBlank
(
corpId
))
{
logger
.
info
(
"企微登录失败auth_code={}"
,
auth_code
);
return
this
.
fail
(
"auth_code解析失败,corpId is null"
);
String
code
=
"1000"
;
try
{
response
.
sendRedirect
(
"/haoban-3/#/gic-error?errorCode="
+
code
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
this
.
fail
(
this
.
errMessage
(
code
));
}
WxEnterpriseDTO
wxEnterprise
=
wxEnterpriseApiService
.
getEnterpriseBycorpId
(
corpId
);
if
(
null
==
wxEnterprise
)
{
logger
.
info
(
"微信企业不存在corpId={}"
,
corpId
);
return
this
.
fail
(
"微信企业不存在,corpId="
+
corpId
);
String
code
=
"1000"
;
try
{
response
.
sendRedirect
(
"/haoban-3/#/gic-error?errorCode="
+
code
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
this
.
fail
(
this
.
errMessage
(
code
));
}
logger
.
info
(
"企微登录wxenterprise={}"
,
JSON
.
toJSONString
(
wxEnterprise
));
String
wxEnterpriseId
=
wxEnterprise
.
getWxEnterpriseId
();
...
...
@@ -120,18 +138,37 @@ public class LoginController extends WebBaseController {
}
logger
.
info
(
"企微登录staff={}"
,
JSON
.
toJSONString
(
loginStaff
));
if
(
loginStaff
==
null
)
{
return
this
.
fail
(
"登录失败,好办管理员不存在"
);
logger
.
info
(
"登录失败,好办管理员不存在"
);
String
code
=
"1000"
;
try
{
response
.
sendRedirect
(
"/haoban-3/#/gic-error?errorCode="
+
code
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
this
.
fail
(
this
.
errMessage
(
code
));
}
String
loginPhoneNumber
=
loginStaff
.
getPhoneNumber
();
if
(
StringUtils
.
isBlank
(
loginPhoneNumber
))
{
logger
.
info
(
"未配置手机号,staffId ={}"
,
loginStaff
.
getStaffId
());
return
this
.
fail
(
"登录失败,未配置手机号"
);
String
code
=
"1000"
;
try
{
response
.
sendRedirect
(
"/haoban-3/#/gic-error?errorCode="
+
code
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
this
.
fail
(
this
.
errMessage
(
code
));
}
List
<
EnterpriseDetailDTO
>
list
=
this
.
wxEnterpriseRelatedApiService
.
listEnterpriseByWxEnterpriseId
(
wxEnterpriseId
,
loginPhoneNumber
,
true
);
if
(
CollectionUtils
.
isEmpty
(
list
))
{
logger
.
info
(
"企微下无管理GIC商户"
);
return
this
.
fail
(
"企微下无管理GIC商户"
);
String
code
=
"1001"
;
try
{
response
.
sendRedirect
(
"/haoban-3/#/gic-error?errorCode="
+
code
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
this
.
fail
(
this
.
errMessage
(
code
));
}
String
gicEnterpriseId
=
list
.
get
(
0
).
getEnterpriseId
();
HaobanUserDTO
dto
=
this
.
haobanUserApiService
.
selectByPhone
(
wxEnterpriseId
,
loginPhoneNumber
)
;
...
...
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