Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
tool
/
xxl-job
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 49ed124b
authored
Jun 17, 2020
by
zhaolong@sunlands.com
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
解决 "https" redirect之后跳转 "http" 问题
1 parent
289f0218
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/IndexController.java
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/PermissionInterceptor.java
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/IndexController.java
View file @
49ed124
...
@@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.InitBinder;
...
@@ -12,6 +12,8 @@ import org.springframework.web.bind.annotation.InitBinder;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.servlet.ModelAndView
;
import
org.springframework.web.servlet.view.RedirectView
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
...
@@ -51,11 +53,12 @@ public class IndexController {
...
@@ -51,11 +53,12 @@ public class IndexController {
@RequestMapping
(
"/toLogin"
)
@RequestMapping
(
"/toLogin"
)
@PermissionLimit
(
limit
=
false
)
@PermissionLimit
(
limit
=
false
)
public
String
toLogin
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
ModelAndView
toLogin
(
HttpServletRequest
request
,
HttpServletResponse
response
,
ModelAndView
modelAndView
)
{
if
(
loginService
.
ifLogin
(
request
,
response
)
!=
null
)
{
if
(
loginService
.
ifLogin
(
request
,
response
)
!=
null
)
{
return
"redirect:/"
;
modelAndView
.
setView
(
new
RedirectView
(
"/"
,
true
,
false
));
return
modelAndView
;
}
}
return
"login"
;
return
new
ModelAndView
(
"login"
)
;
}
}
@RequestMapping
(
value
=
"login"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"login"
,
method
=
RequestMethod
.
POST
)
...
...
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/PermissionInterceptor.java
View file @
49ed124
...
@@ -43,8 +43,8 @@ public class PermissionInterceptor extends HandlerInterceptorAdapter {
...
@@ -43,8 +43,8 @@ public class PermissionInterceptor extends HandlerInterceptorAdapter {
if
(
needLogin
)
{
if
(
needLogin
)
{
XxlJobUser
loginUser
=
loginService
.
ifLogin
(
request
,
response
);
XxlJobUser
loginUser
=
loginService
.
ifLogin
(
request
,
response
);
if
(
loginUser
==
null
)
{
if
(
loginUser
==
null
)
{
response
.
se
ndRedirect
(
request
.
getContextPath
()
+
"/toLogin"
);
response
.
se
tStatus
(
302
);
//request.getRequestDispatcher("/toLogin").forward(request, response
);
response
.
setHeader
(
"location"
,
request
.
getContextPath
()+
"/toLogin"
);
return
false
;
return
false
;
}
}
if
(
needAdminuser
&&
loginUser
.
getRole
()!=
1
)
{
if
(
needAdminuser
&&
loginUser
.
getRole
()!=
1
)
{
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment