Commit d9480e6a by wang_jiaxing

校验注解

parent edeee2d8
...@@ -31,6 +31,9 @@ public class AuthorizationInterceptor implements HandlerInterceptor { ...@@ -31,6 +31,9 @@ public class AuthorizationInterceptor implements HandlerInterceptor {
@Autowired @Autowired
private AuthorizationMapper authorizationMapper; private AuthorizationMapper authorizationMapper;
public static String appId = "founder.appId";
public static String appSecret = "founder.appSecret";
@Override @Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
if (!(handler instanceof HandlerMethod)) { if (!(handler instanceof HandlerMethod)) {
...@@ -64,8 +67,8 @@ public class AuthorizationInterceptor implements HandlerInterceptor { ...@@ -64,8 +67,8 @@ public class AuthorizationInterceptor implements HandlerInterceptor {
response.setContentType("application/json; charset=utf-8"); response.setContentType("application/json; charset=utf-8");
boolean success = true; boolean success = true;
String message = ""; String message = "";
String appId = request.getHeader("founder.appId"); String appId = request.getHeader(AuthorizationInterceptor.appId);
String appSecret = request.getHeader("founder.appSecret"); String appSecret = request.getHeader(AuthorizationInterceptor.appSecret);
if (StringUtils.isEmpty(appId)) { if (StringUtils.isEmpty(appId)) {
success = false; success = false;
message = "appId为空,不能查询!"; message = "appId为空,不能查询!";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment