Browse Source

!188 优化后台 接入BASE64报错信息

Merge pull request !188 from 高雄/N/A
pull/190/MERGE
陈精华 1 year ago committed by Gitee
parent
commit
1e03307657
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
  1. 9
      server/src/main/java/cn/keking/utils/WebUtils.java

9
server/src/main/java/cn/keking/utils/WebUtils.java

@ -27,7 +27,7 @@ import java.util.regex.Pattern;
public class WebUtils {
private static final Logger LOGGER = LoggerFactory.getLogger(WebUtils.class);
private static final String BASE64_MSG = "base64";
/**
* 获取标准的URL
*
@ -243,9 +243,14 @@ public class WebUtils {
try {
return new String(Base64Utils.decodeFromString(source.replaceAll(" ", "+").replaceAll("\n", "")), charsets);
} catch (Exception e) {
LOGGER.error("url解码异常,可能是接入方法错误或者未使用BASE64", e);
if (e.getMessage().toLowerCase().contains(BASE64_MSG)) {
LOGGER.error("url解码异常,接入方法错误未使用BASE64");
}else {
LOGGER.error("url解码异常,其他错误", e);
}
return null;
}
}
}
/**

Loading…
Cancel
Save