mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-05-07 14:18:00 +08:00
添加solon适配及demo
This commit is contained in:
parent
f8f698fc3d
commit
b997a2d870
@ -13,12 +13,12 @@ import org.noear.solon.core.handle.Context;
|
|||||||
* @author noear
|
* @author noear
|
||||||
*/
|
*/
|
||||||
@Component
|
@Component
|
||||||
public class GlobalException implements EventListener<Exception> {
|
public class GlobalException implements EventListener<SaTokenException> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEvent(Exception e) {
|
public void onEvent(SaTokenException e) {
|
||||||
if (e instanceof SaTokenException) {
|
|
||||||
Context c = Context.current();
|
Context c = Context.current();
|
||||||
|
|
||||||
if (c != null) {
|
if (c != null) {
|
||||||
// 不同异常返回不同状态码
|
// 不同异常返回不同状态码
|
||||||
AjaxJson aj = null;
|
AjaxJson aj = null;
|
||||||
@ -42,4 +42,3 @@ public class GlobalException implements EventListener<Exception> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user