|
|
@@ -2,6 +2,7 @@ package com.dk.gateway.oauth.filter;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.dk.gateway.enums.ConstantEnum;
|
|
|
import com.dk.gateway.enums.ErrorCodeEnum;
|
|
|
import com.dk.gateway.oauth.util.AESSecurityUtil;
|
|
|
import com.dk.gateway.oauth.util.JwtUtil;
|
|
|
@@ -13,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
|
|
|
import org.springframework.cloud.gateway.filter.GlobalFilter;
|
|
|
+import org.springframework.core.Constants;
|
|
|
import org.springframework.core.Ordered;
|
|
|
import org.springframework.core.io.buffer.DataBuffer;
|
|
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
|
|
@@ -97,6 +99,12 @@ public class Oauth2Filter implements GlobalFilter, Ordered {
|
|
|
try {
|
|
|
String decrypt = AESSecurityUtil.decrypt(AESKey, tokens[1]);
|
|
|
String userId = JwtUtil.getUserId(decrypt);
|
|
|
+ String userWxId = JwtUtil.getUserWxId(decrypt);
|
|
|
+ // 体验公司不进行验证
|
|
|
+ if(ConstantEnum.PRO_TEST.getName().equals(userWxId) ||
|
|
|
+ ConstantEnum.STD_TEST.getName().equals(userWxId)){
|
|
|
+ return chain.filter(exchange);
|
|
|
+ }
|
|
|
String appCode = JwtUtil.getAppCode(decrypt);
|
|
|
String mapJson = stringRedisTemplate.opsForValue().get("REDIS_USER_LOGIN_" + userId + "_" + appCode);
|
|
|
Map<String, Object> userMap = JSON.parseObject(mapJson);
|