Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gdtel-gztel-school-center
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
吴学德
gdtel-gztel-school-center
Commits
59cf9661
Commit
59cf9661
authored
Apr 20, 2020
by
黄森林
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微信登录修改
parent
f70b2b3e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
21 deletions
+20
-21
common/src/main/java/com/winsun/utils/HttpHelper.java
+14
-15
core-service/src/main/java/com/winsun/item/modular/system/controller/LoginPwdController.java
+6
-6
No files found.
common/src/main/java/com/winsun/utils/HttpHelper.java
View file @
59cf9661
...
...
@@ -89,13 +89,13 @@ public class HttpHelper {
}
}
}
catch
(
IOException
e
)
{
log
.
error
(
"http请求异常"
,
e
.
getMessage
()
);
log
.
error
(
"http请求异常"
+
e
.
getMessage
(),
e
);
}
finally
{
if
(
response
!=
null
)
try
{
response
.
close
();
//释放资源
}
catch
(
IOException
e
)
{
log
.
error
(
"http请求异常"
,
e
.
getMessage
()
);
log
.
error
(
"http请求异常"
+
e
.
getMessage
(),
e
);
}
if
(
httpClient
!=
null
){
httpClient
.
close
();
...
...
@@ -166,14 +166,13 @@ public class HttpHelper {
}
}
}
catch
(
IOException
e
)
{
log
.
error
(
"http请求异常"
,
e
.
getMessage
());
e
.
printStackTrace
();
log
.
error
(
"http请求异常"
+
e
.
getMessage
(),
e
);
}
finally
{
if
(
response
!=
null
)
try
{
response
.
close
();
//释放资源
}
catch
(
IOException
e
)
{
log
.
error
(
"http请求异常"
,
e
.
getMessage
()
);
log
.
error
(
"http请求异常"
+
e
.
getMessage
(),
e
);
}
if
(
httpClient
!=
null
){
httpClient
.
close
();
...
...
@@ -198,11 +197,11 @@ public class HttpHelper {
string
=
EntityUtils
.
toString
(
result
.
getEntity
(),
"utf-8"
);
;
}
catch
(
ClientProtocolException
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"http代理请求异常"
+
e
.
getMessage
(),
e
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"http代理请求异常"
+
e
.
getMessage
(),
e
);
}
catch
(
IllegalStateException
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"http代理请求异常"
+
e
.
getMessage
(),
e
);
}
return
string
;
...
...
@@ -238,17 +237,17 @@ public class HttpHelper {
string
=
EntityUtils
.
toString
(
result
.
getEntity
(),
"utf-8"
);
}
catch
(
ClientProtocolException
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"http代理请求异常"
+
e
.
getMessage
(),
e
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"http代理请求异常"
+
e
.
getMessage
(),
e
);
}
catch
(
IllegalStateException
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"http代理请求异常"
+
e
.
getMessage
(),
e
);
}
finally
{
try
{
httpClient
.
close
();
}
catch
(
IOException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
(
);
log
.
error
(
"http代理请求异常"
+
e
.
getMessage
(),
e
);
}
}
...
...
@@ -278,11 +277,11 @@ public class HttpHelper {
sslContext
);
return
HttpClients
.
custom
().
setSSLSocketFactory
(
sslsf
).
build
();
}
catch
(
KeyManagementException
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"http代理请求异常"
+
e
.
getMessage
(),
e
);
}
catch
(
NoSuchAlgorithmException
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"http代理请求异常"
+
e
.
getMessage
(),
e
);
}
catch
(
KeyStoreException
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"http代理请求异常"
+
e
.
getMessage
(),
e
);
}
return
HttpClients
.
createDefault
();
}
...
...
core-service/src/main/java/com/winsun/item/modular/system/controller/LoginPwdController.java
View file @
59cf9661
...
...
@@ -122,7 +122,7 @@ public class LoginPwdController extends BaseController {
rd
.
forward
(
request
,
response
);
/* response.sendRedirect(url);*/
}
catch
(
Exception
e
)
{
log
.
error
(
"微信授权异常"
,
e
.
getMessage
()
);
log
.
error
(
"微信授权异常"
+
e
.
getMessage
(),
e
);
}
}
...
...
@@ -144,7 +144,7 @@ public class LoginPwdController extends BaseController {
try
{
response
.
sendRedirect
(
url
);
}
catch
(
Exception
e
)
{
log
.
error
(
"微信授权异常"
,
e
.
getMessage
()
);
log
.
error
(
"微信授权异常"
+
e
.
getMessage
(),
e
);
}
}
...
...
@@ -177,7 +177,7 @@ public class LoginPwdController extends BaseController {
try
{
jsonObject
=
HttpHelper
.
sendGet
(
url
);
}
catch
(
Exception
e
)
{
log
.
error
(
"微信登录获取用户信息失败"
,
e
.
getMessage
()
);
log
.
error
(
"微信登录获取用户信息失败"
+
e
.
getMessage
(),
e
);
}
if
(
jsonObject
==
null
)
{
return
ResponseData
.
error
(
"微信授权失效,请重新授权!"
);
...
...
@@ -237,7 +237,7 @@ public class LoginPwdController extends BaseController {
try
{
jsonObject
=
HttpHelper
.
sendGet
(
url
);
}
catch
(
Exception
e
)
{
log
.
error
(
"微信登录获取用户信息失败"
,
e
.
getMessage
()
);
log
.
error
(
"微信登录获取用户信息失败"
+
e
.
getMessage
(),
e
);
}
if
(
jsonObject
==
null
)
{
return
ResponseData
.
error
(
"微信授权失效,请重新授权!"
);
...
...
@@ -296,7 +296,7 @@ public class LoginPwdController extends BaseController {
try
{
jsonObject
=
HttpHelper
.
doGet
(
url
);
}
catch
(
Exception
e
)
{
log
.
error
(
"微信登录获取用户信息失败"
,
e
.
getMessage
()
);
log
.
error
(
"微信登录获取用户信息失败"
+
e
.
getMessage
(),
e
);
}
if
(
jsonObject
==
null
)
{
return
ResponseData
.
error
(
"微信授权失效,请重新授权!"
);
...
...
@@ -363,7 +363,7 @@ public class LoginPwdController extends BaseController {
}
}
}
catch
(
Exception
e
)
{
log
.
info
(
"错误信息:{}"
,
e
.
getMessage
()
);
log
.
info
(
"错误信息:{}"
+
e
.
getMessage
(),
e
);
sent
.
put
(
"message"
,
"手机短信发送失败"
);
}
...
...
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