mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-05-03 20:27:54 +08:00
commit
2dce51bfbf
@ -13,7 +13,7 @@ Sa-Token 中的基础异常类是 `SaTokenException`,在此基础上,又针
|
||||
|
||||
``` java
|
||||
if(SaFoxUtil.isUrl(url) == false) {
|
||||
throw new SaSsoException("无效redirect:" + url).setCode(SaSsoExceptionCode.CODE_20001);
|
||||
throw new SaSsoException("无效redirect:" + url).setCode(SaSsoErrorCode.CODE_30001);
|
||||
}
|
||||
```
|
||||
|
||||
@ -28,13 +28,13 @@ public class GlobalExceptionHandler {
|
||||
public SaResult handlerSaTokenException(SaTokenException e) {
|
||||
|
||||
// 根据不同异常细分状态码返回不同的提示
|
||||
if(e.getCode() == 20001) {
|
||||
if(e.getCode() == 30001) {
|
||||
return SaResult.error("redirect 重定向 url 是一个无效地址");
|
||||
}
|
||||
if(e.getCode() == 20002) {
|
||||
if(e.getCode() == 30002) {
|
||||
return SaResult.error("redirect 重定向 url 不在 allowUrl 允许的范围内");
|
||||
}
|
||||
if(e.getCode() == 20004) {
|
||||
if(e.getCode() == 30004) {
|
||||
return SaResult.error("提供的 ticket 是无效的");
|
||||
}
|
||||
// 更多 code 码判断 ...
|
||||
|
Loading…
Reference in New Issue
Block a user