Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
wwwanlingxiao
mall
Commits
d11be8cc
Commit
d11be8cc
authored
Apr 03, 2020
by
macro
Browse files
跨域问题修复
parent
56bd1549
Changes
1
Hide whitespace changes
Inline
Side-by-side
mall-security/src/main/java/com/macro/mall/security/component/RestAuthenticationEntryPoint.java
View file @
d11be8cc
...
...
@@ -18,6 +18,8 @@ import java.io.IOException;
public
class
RestAuthenticationEntryPoint
implements
AuthenticationEntryPoint
{
@Override
public
void
commence
(
HttpServletRequest
request
,
HttpServletResponse
response
,
AuthenticationException
authException
)
throws
IOException
,
ServletException
{
response
.
setHeader
(
"Access-Control-Allow-Origin"
,
"*"
);
response
.
setHeader
(
"Cache-Control"
,
"no-cache"
);
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setContentType
(
"application/json"
);
response
.
getWriter
().
println
(
JSONUtil
.
parse
(
CommonResult
.
unauthorized
(
authException
.
getMessage
())));
...
...
Write
Preview
Supports
Markdown
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