bilingfeng 1 рік тому
батько
коміт
307c8a3a9d

+ 12 - 0
game-module/game-module-sdk/src/main/java/com/zanxiang/game/module/sdk/service/impl/OrderPayServiceImpl.java

@@ -21,6 +21,7 @@ import com.zanxiang.module.util.exception.BaseException;
 import com.zanxiang.module.web.util.IpUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
 import javax.servlet.http.HttpServletRequest;
@@ -52,6 +53,12 @@ public class OrderPayServiceImpl implements IOrderPayService {
     @Autowired
     private IPayApplicationService payApplicationService;
 
+    /**
+     * 服务器域名
+     */
+    @Value("${server.domain}")
+    private String serverUrl;
+
     @Override
     public PayParamVO getPayParam(String code, String orderId, HttpServletRequest request) {
         Order order = orderService.getOne(new LambdaQueryWrapper<Order>()
@@ -154,6 +161,11 @@ public class OrderPayServiceImpl implements IOrderPayService {
             paramMap.put("path", payApplicationDTO.getPath());
             paramMap.put("orderId", product.getOrderId());
             paramMap.put("amount", product.getAmount());
+            if (this.serverUrl.contains("84game")) {
+                paramMap.put("serverUrl", this.serverUrl + "/sdk");
+            } else {
+                paramMap.put("serverUrl", this.serverUrl + "/api/sdk");
+            }
             log.error("下单参数返回, paramMap : {}", JsonUtil.toString(paramMap));
             return paramMap;
         }