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
85fb3706
Commit
85fb3706
authored
Nov 10, 2019
by
macro
Browse files
删除无用组件
parent
3ce81d9c
Changes
5
Hide whitespace changes
Inline
Side-by-side
mall-portal/src/main/java/com/macro/mall/portal/component/GoAccessDeniedHandler.java
deleted
100644 → 0
View file @
3ce81d9c
package
com.macro.mall.portal.component
;
import
cn.hutool.json.JSONUtil
;
import
com.macro.mall.common.api.CommonResult
;
import
org.springframework.security.access.AccessDeniedException
;
import
org.springframework.security.web.access.AccessDeniedHandler
;
import
javax.servlet.ServletException
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
/**
* Created by macro on 2018/8/6.
*/
public
class
GoAccessDeniedHandler
implements
AccessDeniedHandler
{
@Override
public
void
handle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
AccessDeniedException
accessDeniedException
)
throws
IOException
,
ServletException
{
response
.
setHeader
(
"Content-Type"
,
"application/json;charset=utf-8"
);
response
.
getWriter
().
print
(
JSONUtil
.
parse
(
CommonResult
.
forbidden
(
accessDeniedException
.
getMessage
())));
response
.
getWriter
().
flush
();
}
}
mall-portal/src/main/java/com/macro/mall/portal/component/GoAuthenticationEntryPoint.java
deleted
100644 → 0
View file @
3ce81d9c
package
com.macro.mall.portal.component
;
import
cn.hutool.json.JSONUtil
;
import
com.macro.mall.common.api.CommonResult
;
import
org.springframework.security.core.AuthenticationException
;
import
org.springframework.security.web.AuthenticationEntryPoint
;
import
javax.servlet.ServletException
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
/**
* Created by macro on 2018/8/6.
*/
public
class
GoAuthenticationEntryPoint
implements
AuthenticationEntryPoint
{
@Override
public
void
commence
(
HttpServletRequest
request
,
HttpServletResponse
response
,
AuthenticationException
authException
)
throws
IOException
,
ServletException
{
response
.
setHeader
(
"Content-Type"
,
"application/json;charset=utf-8"
);
response
.
getWriter
().
print
(
JSONUtil
.
parse
(
CommonResult
.
unauthorized
(
authException
.
getMessage
())));
response
.
getWriter
().
flush
();
}
}
mall-portal/src/main/java/com/macro/mall/portal/component/GoAuthenticationFailureHandler.java
deleted
100644 → 0
View file @
3ce81d9c
package
com.macro.mall.portal.component
;
import
cn.hutool.json.JSONUtil
;
import
com.macro.mall.common.api.CommonResult
;
import
org.springframework.security.core.AuthenticationException
;
import
org.springframework.security.web.authentication.AuthenticationFailureHandler
;
import
javax.servlet.ServletException
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
/**
* Created by macro on 2018/8/6.
*/
public
class
GoAuthenticationFailureHandler
implements
AuthenticationFailureHandler
{
@Override
public
void
onAuthenticationFailure
(
HttpServletRequest
request
,
HttpServletResponse
response
,
AuthenticationException
exception
)
throws
IOException
,
ServletException
{
response
.
setHeader
(
"Content-Type"
,
"application/json;charset=utf-8"
);
response
.
getWriter
().
print
(
JSONUtil
.
parse
(
CommonResult
.
failed
(
"登录失败,用户名或密码错误!"
)));
response
.
getWriter
().
flush
();
}
}
mall-portal/src/main/java/com/macro/mall/portal/component/GoAuthenticationSuccessHandler.java
deleted
100644 → 0
View file @
3ce81d9c
package
com.macro.mall.portal.component
;
import
cn.hutool.json.JSONUtil
;
import
com.macro.mall.common.api.CommonResult
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.web.authentication.AuthenticationSuccessHandler
;
import
javax.servlet.ServletException
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
/**
* Created by macro on 2018/8/6.
*/
public
class
GoAuthenticationSuccessHandler
implements
AuthenticationSuccessHandler
{
@Override
public
void
onAuthenticationSuccess
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Authentication
authentication
)
throws
IOException
,
ServletException
{
response
.
setHeader
(
"Content-Type"
,
"application/json;charset=utf-8"
);
response
.
getWriter
().
print
(
JSONUtil
.
parse
(
CommonResult
.
success
(
null
,
"登录成功"
)));
response
.
getWriter
().
flush
();
}
}
mall-portal/src/main/java/com/macro/mall/portal/component/GoLogoutSuccessHandler.java
deleted
100644 → 0
View file @
3ce81d9c
package
com.macro.mall.portal.component
;
import
cn.hutool.json.JSONUtil
;
import
com.macro.mall.common.api.CommonResult
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.web.authentication.logout.LogoutSuccessHandler
;
import
javax.servlet.ServletException
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
/**
* Created by macro on 2018/8/6.
*/
public
class
GoLogoutSuccessHandler
implements
LogoutSuccessHandler
{
@Override
public
void
onLogoutSuccess
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Authentication
authentication
)
throws
IOException
,
ServletException
{
response
.
setHeader
(
"Content-Type"
,
"application/json;charset=utf-8"
);
response
.
getWriter
().
print
(
JSONUtil
.
parse
(
CommonResult
.
success
(
null
,
"已注销"
)));
response
.
getWriter
().
flush
();
}
}
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