Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
saasio
Project
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
reyun
saasio
Commits
acba4819
Commit
acba4819
authored
Jun 12, 2018
by
carrieyzzhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
openid
parent
c14d14a5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
LoginController.java
src/main/java/com/reyun/controller/LoginController.java
+12
-7
AuthorizationInterceptor.java
.../reyun/security/interceptor/AuthorizationInterceptor.java
+1
-0
No files found.
src/main/java/com/reyun/controller/LoginController.java
View file @
acba4819
...
@@ -10,13 +10,7 @@ import com.reyun.security.TokenManager;
...
@@ -10,13 +10,7 @@ import com.reyun.security.TokenManager;
import
com.reyun.security.annotation.CurrentAccount
;
import
com.reyun.security.annotation.CurrentAccount
;
import
com.reyun.security.interceptor.AuthorizationInterceptor
;
import
com.reyun.security.interceptor.AuthorizationInterceptor
;
import
com.reyun.service.*
;
import
com.reyun.service.*
;
import
com.reyun.util.CipherUtil
;
import
com.reyun.util.*
;
import
com.reyun.util.Constant
;
import
com.reyun.util.DateUtil
;
import
com.reyun.util.ResultModel
;
import
com.reyun.util.StringUtil
;
import
com.reyun.util.ValidateCodeUtil
;
import
com.reyun.util.ValidateUtil
;
import
net.sf.json.JSONObject
;
import
net.sf.json.JSONObject
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -288,4 +282,15 @@ public class LoginController
...
@@ -288,4 +282,15 @@ public class LoginController
logger
.
error
(
e
.
getMessage
());
logger
.
error
(
e
.
getMessage
());
}
}
}
}
@RequestMapping
(
value
=
"getopenid"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
String
getOpenid
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
String
code
=
request
.
getParameter
(
"js_code"
);
String
appId
=
"wxd7411c633c54c5ab"
;
String
appSecret
=
"69834fabd641256ec29b052743616308"
;
String
url
=
"https://api.weixin.qq.com/sns/jscode2session?appid="
+
appId
+
"&secret="
+
appSecret
+
"&grant_type=authorization_code&js_code="
+
code
;
String
responseStr
=
HttpClientUtil
.
doHttpGetRequest
(
url
,
""
);
return
responseStr
;
}
}
}
src/main/java/com/reyun/security/interceptor/AuthorizationInterceptor.java
View file @
acba4819
...
@@ -78,6 +78,7 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
...
@@ -78,6 +78,7 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {
if
(
request
.
getRequestURL
().
indexOf
(
"login/login"
)
!=
-
1
if
(
request
.
getRequestURL
().
indexOf
(
"login/login"
)
!=
-
1
||
request
.
getRequestURL
().
indexOf
(
"login/loginweb"
)
!=
-
1
||
request
.
getRequestURL
().
indexOf
(
"login/loginweb"
)
!=
-
1
||
request
.
getRequestURL
().
indexOf
(
"login/getvalidcode"
)
!=
-
1
||
request
.
getRequestURL
().
indexOf
(
"login/getvalidcode"
)
!=
-
1
||
request
.
getRequestURL
().
indexOf
(
"login/getopenid"
)
!=
-
1
||
request
.
getRequestURL
().
indexOf
(
"external/download"
)
!=
-
1
||
request
.
getRequestURL
().
indexOf
(
"external/download"
)
!=
-
1
||
request
.
getRequestURL
().
indexOf
(
"openapi/toutiao"
)
!=
-
1
||
request
.
getRequestURL
().
indexOf
(
"openapi/toutiao"
)
!=
-
1
// || request.getRequestURL().indexOf("event/find") != -1
// || request.getRequestURL().indexOf("event/find") != -1
...
...
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