Browse Source

【修复】pay:PayWalletServiceImpl 可能存在的循环依赖问题
【修复】system:dev 配置文件,缺少 WECHAT_MINI_APP 配置项~

YunaiV 1 year ago
parent
commit
da5425da2f

+ 4 - 2
yudao-module-pay/yudao-module-pay-biz/src/main/java/cn/iocoder/yudao/module/pay/service/wallet/PayWalletServiceImpl.java

@@ -36,13 +36,15 @@ public class PayWalletServiceImpl implements  PayWalletService {
 
 
     @Resource
     @Resource
     private PayWalletMapper walletMapper;
     private PayWalletMapper walletMapper;
+
     @Resource
     @Resource
+    @Lazy // 延迟加载,避免循环依赖
     private PayWalletTransactionService walletTransactionService;
     private PayWalletTransactionService walletTransactionService;
     @Resource
     @Resource
-    @Lazy
+    @Lazy // 延迟加载,避免循环依赖
     private PayOrderService orderService;
     private PayOrderService orderService;
     @Resource
     @Resource
-    @Lazy
+    @Lazy // 延迟加载,避免循环依赖
     private PayRefundService refundService;
     private PayRefundService refundService;
 
 
     @Override
     @Override

+ 10 - 0
yudao-server/src/main/resources/application-dev.yaml

@@ -198,6 +198,16 @@ justauth:
       client-secret: 1wTb7hYxnpT2TUbIeHGXGo7T0odav1ic10mLdyyATOw
       client-secret: 1wTb7hYxnpT2TUbIeHGXGo7T0odav1ic10mLdyyATOw
       agent-id: 1000004
       agent-id: 1000004
       ignore-check-redirect-uri: true
       ignore-check-redirect-uri: true
+    # noinspection SpringBootApplicationYaml
+    WECHAT_MINI_APP: # 微信小程序
+      client-id: ${wx.miniapp.appid}
+      client-secret: ${wx.miniapp.secret}
+      ignore-check-redirect-uri: true
+      ignore-check-state: true # 微信小程序,不会使用到 state,所以不进行校验
+    WECHAT_MP: # 微信公众号
+      client-id: ${wx.mp.app-id}
+      client-secret: ${wx.mp.secret}
+      ignore-check-redirect-uri: true
   cache:
   cache:
     type: REDIS
     type: REDIS
     prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::
     prefix: 'social_auth_state:' # 缓存前缀,目前只对 Redis 缓存生效,默认 JUSTAUTH::STATE::

+ 1 - 0
yudao-server/src/main/resources/application-local.yaml

@@ -254,6 +254,7 @@ justauth:
       client-secret: 1wTb7hYxnpT2TUbIeHGXGo7T0odav1ic10mLdyyATOw
       client-secret: 1wTb7hYxnpT2TUbIeHGXGo7T0odav1ic10mLdyyATOw
       agent-id: 1000004
       agent-id: 1000004
       ignore-check-redirect-uri: true
       ignore-check-redirect-uri: true
+    # noinspection SpringBootApplicationYaml
     WECHAT_MINI_APP: # 微信小程序
     WECHAT_MINI_APP: # 微信小程序
       client-id: ${wx.miniapp.appid}
       client-id: ${wx.miniapp.appid}
       client-secret: ${wx.miniapp.secret}
       client-secret: ${wx.miniapp.secret}