12 changed files with 56 additions and 15 deletions
@ -0,0 +1,36 @@ |
|||||||
|
package com.cloud.kicc.common.security.exception; |
||||||
|
|
||||||
|
import com.fasterxml.jackson.databind.annotation.JsonSerialize; |
||||||
|
import org.springframework.http.HttpStatus; |
||||||
|
|
||||||
|
/** |
||||||
|
*<p> |
||||||
|
* 安全检查异常 |
||||||
|
* 可绕过前端设置的状态码提示消息 |
||||||
|
*</p> |
||||||
|
* |
||||||
|
* @Author: entfrm开发团队-王翔 |
||||||
|
* @Date: 2022/2/18 |
||||||
|
*/ |
||||||
|
@JsonSerialize(using = KiccAuth2ExceptionSerializer.class) |
||||||
|
public class SecurityCheckedException extends KiccAuth2Exception { |
||||||
|
|
||||||
|
public SecurityCheckedException(String msg) { |
||||||
|
super(msg); |
||||||
|
} |
||||||
|
|
||||||
|
public SecurityCheckedException(String msg, Throwable t) { |
||||||
|
super(msg, t); |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public String getOAuth2ErrorCode() { |
||||||
|
return "checked_not_pass"; |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public int getHttpErrorCode() { |
||||||
|
return HttpStatus.NETWORK_AUTHENTICATION_REQUIRED.value(); |
||||||
|
} |
||||||
|
|
||||||
|
} |
Loading…
Reference in new issue