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

Merge pull request !188 from 高雄/N/A
This commit is contained in:
陈精华
2023-07-28 09:01:06 +00:00
committed by Gitee

View File

@@ -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,10 +243,15 @@ 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;
}
}
}
/**
* 获取 url 的 host