zx 4 天之前
父节点
当前提交
3053120a6a
共有 1 个文件被更改,包括 8 次插入1 次删除
  1. 8 1
      fs-user-app/src/main/java/com/fs/app/controller/store/PaymentScrmController.java

+ 8 - 1
fs-user-app/src/main/java/com/fs/app/controller/store/PaymentScrmController.java

@@ -44,7 +44,14 @@ public class PaymentScrmController extends AppBaseController {
     @PostMapping("/payment")
     @RepeatSubmit
     public R payment(@Validated @RequestBody FsStorePaymentPayParam payment, HttpServletRequest request){
-        final WxMaService wxService = WxMaConfiguration.getMaService(properties.getConfigs().get(0).getAppid());
+        String appId = null;
+        if (payment.getAppId()!=null && !"".equals(payment.getAppId())){
+            appId= payment.getAppId();
+        }else {
+            appId=properties.getConfigs().get(0).getAppid();
+        }
+
+        final WxMaService wxService = WxMaConfiguration.getMaService(appId);
         try {
             String ip = IpUtil.getRequestIp();
             WxMaJscode2SessionResult session = wxService.getUserService().getSessionInfo(payment.getCode());