Browse Source

Merge remote-tracking branch 'origin/Payment-Configuration' into Payment-Configuration

xgb 1 tuần trước cách đây
mục cha
commit
b5f4c20f66

+ 10 - 10
fs-service/src/main/java/com/fs/course/utils/WechatErrorUtil.java

@@ -8,7 +8,7 @@ import java.util.Map;
 
 /**
  * 微信错误处理工具类
- * 
+ *
  * @author system
  */
 @Slf4j
@@ -28,7 +28,7 @@ public class WechatErrorUtil {
         if (errcode == null) {
             return "微信接口调用失败";
         }
-        
+
         switch (errcode) {
             case 40001:
                 return "微信access_token无效或已过期";
@@ -47,7 +47,7 @@ public class WechatErrorUtil {
             case 50003:
                 return "微信小程序未发布,无法生成链接";
             case 85079:
-                return "微信小程序程序代码已发布,不能重新发布";
+                return "微信小程序程序代码待发布,请先发布版本";
             case 85301:
                 return "微信小程序审核未通过";
             case 89449:
@@ -59,32 +59,32 @@ public class WechatErrorUtil {
 
     /**
      * 处理WxErrorException异常
-     * 
+     *
      * @param e WxErrorException异常
      * @param defaultMessage 默认错误信息
      * @return 格式化后的错误信息(错误码|错误信息)
      */
     public static String handleWxErrorException(WxErrorException e, String defaultMessage) {
         log.error("微信API调用异常", e);
-        
+
         // WxErrorException 包含微信返回的错误信息
         Integer errcode = e.getError().getErrorCode();
         String errmsg = e.getError().getErrorMsg();
-        
+
         // 如果有微信错误码,使用微信的错误处理逻辑
         if (errcode != null) {
             String friendlyMsg = getFriendlyMessage(errcode);
             log.error("微信返回错误,错误码:{},原始信息:{},友好提示:{}", errcode, errmsg, friendlyMsg);
             return formatError(errcode, friendlyMsg);
         }
-        
+
         // 否则返回默认错误
         return formatError(-2, defaultMessage);
     }
 
     /**
      * 解析错误信息,返回包含错误码和错误信息的Map
-     * 
+     *
      * @param errorMsg 错误信息(格式:错误码|错误信息)
      * @return Map包含errcode和msg,如果格式不正确返回null
      */
@@ -92,12 +92,12 @@ public class WechatErrorUtil {
         if (errorMsg == null || !errorMsg.contains("|")) {
             return null;
         }
-        
+
         String[] parts = errorMsg.split("\\|", 2);
         if (parts.length != 2) {
             return null;
         }
-        
+
         try {
             Integer errcode = Integer.parseInt(parts[0]);
             Map<String, Object> result = new HashMap<>();