|
@@ -1,6 +1,7 @@
|
|
|
package com.diagbot.config.security;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.diagbot.exception.CommonException;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.SecurityMetadataSource;
|
|
|
import org.springframework.security.access.intercept.AbstractSecurityInterceptor;
|
|
@@ -46,12 +47,12 @@ public class UrlFilterSecurityInterceptor extends AbstractSecurityInterceptor im
|
|
|
FilterInvocation fi = new FilterInvocation(request, response, chain);
|
|
|
try {
|
|
|
invoke(fi);
|
|
|
- }catch (Exception e)
|
|
|
+ }catch (CommonException e)
|
|
|
{
|
|
|
JSONObject error = new JSONObject();
|
|
|
response.setContentType("text/html;charset=utf-8");
|
|
|
- error.put("code","00000001");
|
|
|
- error.put("msg",e.getMessage());
|
|
|
+ error.put("code",e.getCode());
|
|
|
+ error.put("msg", e.getMessage());
|
|
|
response.getWriter().println(error);
|
|
|
response.flushBuffer();
|
|
|
}
|