Explorar o código

微信支付中文域名无法会跳

夏文涛 %!s(int64=2) %!d(string=hai) anos
pai
achega
48bafcdf3b

+ 7 - 2
mhotel/src/com/happy/Model/weixin/WeiXinUtil.java

@@ -13,8 +13,13 @@ public class WeiXinUtil {
     public static String key = "gjkgjdkoowpjc46352AqiTTv708poJNV"; // 商户密钥
     public static String account = "1650403896";  // 商户号
 
-    public static String ip = "172.16.20.88";
-    public static String ip_h = "https://chtech.ncjti.edu.cn/hotelReservation/mhotel";
+    public static String ip = "101.42.162.31";//测试回跳ip
+                              // "172.16.20.88";//线上回跳ip
+    public static String ip_h = "https://chtech.ncjti.edu.cn/homestay/mhotel/";//31回调地址
+                                //"https://www.xn--gmq052a5d255v.com/hotelReservation/mhotel";//测试回跳地址 这个中文域名测试跳不过去
+                                // 不知道这个乡宿的域名微信是否会回调,不会的话要改成 https://chtech.ncjti.edu.cn/homestay/mhotel/
+                                // "https://chtech.ncjti.edu.cn/hotelReservation/mhotel";//88线上回跳地址
+
     //public static String ip_q = "https://chtech.ncjti.edu.cn/hotelReservation/dist";
     public static String ip_q = "http://192.168.161.227:8000/hotelReservation/dist";
 

+ 10 - 1
mhotel/src/com/happy/action/AppMePageAction.java

@@ -523,7 +523,16 @@ public class AppMePageAction extends ActionSupport implements ServletRequestAwar
             return null;
         }
 
-        String userId = AesUtils.decrypt(token);
+        String userId = null;
+        try{
+            userId = AesUtils.decrypt(token);
+        }catch (Exception e){
+            resultJson.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());
+            resultJson.put(B.message, "token不合法,无法获取用户信息");
+            ResponseUtil.writeJson(ServletActionContext.getResponse(), resultJson.toString());
+            return null;
+        }
+
 
         if(userId == null){
             resultJson.put(B.code, ResultStatusCode.BAD_REQUEST.getStatus());