|
@@ -1,6 +1,7 @@
|
|
|
package com.qs.mp.handler.auth;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.qs.mp.common.enums.ServerEnvEnum;
|
|
|
import com.qs.mp.common.utils.LogUtil;
|
|
|
import com.qs.mp.common.utils.http.HttpHelper;
|
|
|
import com.qs.mp.core.domain.LoginUser;
|
|
@@ -13,6 +14,7 @@ import org.apache.commons.lang.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.lang.Nullable;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
import org.springframework.web.method.HandlerMethod;
|
|
@@ -36,6 +38,11 @@ public class SignInterceptor implements HandlerInterceptor {
|
|
|
@Autowired
|
|
|
private HostHolder hostHolder;
|
|
|
|
|
|
+ @Value(value = "${server.env}")
|
|
|
+ private String env;
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
|
@@ -43,6 +50,9 @@ public class SignInterceptor implements HandlerInterceptor {
|
|
|
if (!(handler instanceof HandlerMethod)) {
|
|
|
return true;
|
|
|
}
|
|
|
+ if (ServerEnvEnum.DEV.getCode().equals(env)) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
String method = request.getMethod();
|
|
|
if ("post".equalsIgnoreCase(method)) {
|
|
|
// 最后用RequestBody中获取token
|