用户未登录异常捕获
This commit is contained in:
parent
f99fef01d9
commit
b4c65aebd2
@ -1,5 +1,6 @@
|
|||||||
package com.cdzy.user.config;
|
package com.cdzy.user.config;
|
||||||
|
|
||||||
|
import cn.dev33.satoken.exception.NotLoginException;
|
||||||
import com.alibaba.nacos.shaded.com.google.gson.JsonSyntaxException;
|
import com.alibaba.nacos.shaded.com.google.gson.JsonSyntaxException;
|
||||||
import com.cdzy.common.ex.EbikeException;
|
import com.cdzy.common.ex.EbikeException;
|
||||||
import com.cdzy.common.model.response.JsonResult;
|
import com.cdzy.common.model.response.JsonResult;
|
||||||
@ -104,6 +105,14 @@ public class GlobalExceptionHandler {
|
|||||||
return JsonResult.failed(e.getMessage());
|
return JsonResult.failed(e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ResponseBody
|
||||||
|
@ExceptionHandler
|
||||||
|
public JsonResult<?> exp(HttpServletRequest request, NotLoginException e) {
|
||||||
|
// LogFactory.getLog(super.getClass()).error(e.getMessage(), e);
|
||||||
|
log.error(request.getServletPath(), e);
|
||||||
|
return JsonResult.failed(e.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@ExceptionHandler
|
@ExceptionHandler
|
||||||
public JsonResult<?> exp(HttpServletRequest request, EbikeException e) {
|
public JsonResult<?> exp(HttpServletRequest request, EbikeException e) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user