lijilei 3 lat temu
rodzic
commit
82cc0cd2b0

+ 2 - 1
book-server/src/main/java/com/book/server/service/impl/WxPayServiceImpl.java

@@ -243,8 +243,9 @@ public class WxPayServiceImpl implements WxPayService {
         Wxpay wxpay = wxpayMapper.selectByPrimaryKey(wxpayId);
         String appid = wxpay.getAppid();
         String secret = wxpay.getSecret();
+        String host = wxpay.getPayHost();
         if (StringUtils.isEmpty(code)) {
-            String redirectUrl = "http://" + domain + "/api/wxpay/login?userId=" + userId;
+            String redirectUrl = "http://" + host + "/api/wxpay/login?userId=" + userId;
             String url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=%s&redirect_uri=%s&response_type=code&scope=snsapi_base&state=%s#wechat_redirect";
             try {
                 url = String.format(url, appid, java.net.URLEncoder.encode(redirectUrl, "UTF-8"), userId);