Commit 2abb498a authored by 吴林峰's avatar 吴林峰

Merge branch 'dev-8.9.0' into 'master'

Dev 8.9.0

See merge request !17
parents 46077c2c 03de176d
...@@ -4,8 +4,9 @@ import cn.hutool.core.util.StrUtil; ...@@ -4,8 +4,9 @@ import cn.hutool.core.util.StrUtil;
import com.afanticar.afantiopenapi.controller.BaseController; import com.afanticar.afantiopenapi.controller.BaseController;
import com.afanticar.afantiopenapi.utils.JWTUtils; import com.afanticar.afantiopenapi.utils.JWTUtils;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor; import org.springframework.web.servlet.HandlerInterceptor;
...@@ -18,17 +19,19 @@ import java.util.Set; ...@@ -18,17 +19,19 @@ import java.util.Set;
* @contact chenyan@afanticar.com * @contact chenyan@afanticar.com
* @since 2023/4/26/026 * @since 2023/4/26/026
*/ */
@Component
@Slf4j @Slf4j
@Setter
@Component
@ConfigurationProperties(prefix = "ignored")
public class TokenInterceptor implements HandlerInterceptor { public class TokenInterceptor implements HandlerInterceptor {
@Value("#{'${ignored.uri}'.split(',')}") private Set<String> uris;
private Set<String> ignoredUris;
@Override @Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
String requestUri = request.getRequestURI(); String requestUri = request.getRequestURI();
if (ignoredUris.contains(requestUri)) { if (uris.contains(requestUri)) {
return true; return true;
} }
String token = request.getHeader("authorization"); String token = request.getHeader("authorization");
......
...@@ -67,6 +67,7 @@ public class FawOpenController extends BaseController { ...@@ -67,6 +67,7 @@ public class FawOpenController extends BaseController {
@RequestParam(name = "publish_date_start") @DateTimeFormat(pattern = "yyyy-MM-dd") Date publishDateStart, @RequestParam(name = "publish_date_start") @DateTimeFormat(pattern = "yyyy-MM-dd") Date publishDateStart,
@RequestParam(name = "publish_date_end") @DateTimeFormat(pattern = "yyyy-MM-dd") Date publishDateEnd, @RequestParam(name = "publish_date_end") @DateTimeFormat(pattern = "yyyy-MM-dd") Date publishDateEnd,
@RequestParam(name = "type") String type) { @RequestParam(name = "type") String type) {
log.info("AAAAAAAAA:" + limit);
BaseResponse check = baseService.baseValidator(request,client, dataType, limit, limitPeriod); BaseResponse check = baseService.baseValidator(request,client, dataType, limit, limitPeriod);
if (check != null) { if (check != null) {
return check; return check;
......
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