Browse Source

feature 代码优化

xiahan 3 weeks ago
parent
commit
a51d3f29c5

+ 1 - 6
zhsw-wechat-common/src/main/java/com/rongwei/wechat/system/config/ZHSWQuerySqlAdaptationInterceptor.java

@@ -147,12 +147,6 @@ public class ZHSWQuerySqlAdaptationInterceptor implements Interceptor {
             logger.info("通过请求头获取到的schema:" + schema);
             return schema;
         }
-        Object attributeSchema = request.getAttribute("schema");
-        if (attributeSchema != null && StringUtils.isNotBlank(attributeSchema.toString())) {
-            schema = (String) attributeSchema;
-            logger.info("通过请求属性获取到的schema:" + schema);
-            return schema;
-        }
         String token = request.getHeader("token");
         logger.info("token:" + token);
 //        if(StringUtils.isBlank(token)){
@@ -180,6 +174,7 @@ public class ZHSWQuerySqlAdaptationInterceptor implements Interceptor {
 //        }
         Object tokenDskey = request.getAttribute(Constants.SAAS_LOGIN_TOKEN);
         if (tokenDskey != null && StringUtils.isNotBlank(tokenDskey.toString())) {
+            logger.info("通过请求属性获取到的schema" + tokenDskey);
             schema = (String) tokenDskey;
         } else {
             schema = getSchemaByToken(token);

+ 2 - 1
zhsw-wechat-common/src/main/java/com/rongwei/wechat/system/wechat/impl/PayMentServiceImpl.java

@@ -14,6 +14,7 @@ import com.rongwei.commonservice.service.impl.RedisServiceImpl;
 import com.rongwei.rwcommon.base.BaseDo;
 import com.rongwei.rwcommon.base.R;
 import com.rongwei.rwcommon.base.exception.CustomException;
+import com.rongwei.rwcommon.utils.Constants;
 import com.rongwei.rwcommon.utils.SecurityUtil;
 import com.rongwei.wechat.system.config.WeChatAboutApiPara;
 import com.rongwei.wechat.system.dao.CommonBusinessDao;
@@ -201,7 +202,7 @@ public class PayMentServiceImpl implements PayMentService {
         R error = R.error("失败");
         // dsKeys.remove("incontrol");
         log.info("schema为:{}", dskey);
-        httpServletRequest.setAttribute("schema", dskey);
+        httpServletRequest.setAttribute(Constants.SAAS_LOGIN_TOKEN, dskey);
         // 获取所有商户的密钥
         List<SwEnterpriseConfigInfoDo> secretKeyList = commonBusinessDao.getSecretKey(Collections.singletonList(dskey));
         String analysisStr = null;