Commit c4fb158d by 李传峰

移除不必要error日志

parent 458707da
...@@ -145,17 +145,13 @@ public class Cookie { ...@@ -145,17 +145,13 @@ public class Cookie {
*/ */
public static Map<String, Object> getUserInfo(String userInfo) throws BizException { public static Map<String, Object> getUserInfo(String userInfo) throws BizException {
if (StringUtil.isEmpty(userInfo)) { if (StringUtil.isEmpty(userInfo)) {
LOGGER.warn("Cookie解析失败:userInfo==NULL");
throw BizException.COOKIE_IS_ILLICIT; throw BizException.COOKIE_IS_ILLICIT;
} }
try { try {
userInfo = URLDecoder.decode(userInfo, "UTF-8"); userInfo = URLDecoder.decode(userInfo, "UTF-8");
LOGGER.info("Cookie的内容如下:" + String.valueOf(userInfo)); LOGGER.info("Cookie的内容如下:{}" , userInfo);
} catch (UnsupportedEncodingException e) {
LOGGER.error("Cookie解析失败:" + e.getMessage(), e);
throw BizException.COOKIE_IS_ILLICIT;
} catch (Exception e) { } catch (Exception e) {
LOGGER.error("Cookie解析失败:" + e.getMessage(), e); LOGGER.error("Cookie解析失败:{}" , e.getMessage(), e);
throw BizException.COOKIE_IS_ILLICIT; throw BizException.COOKIE_IS_ILLICIT;
} }
Map<String, Object> userInfos = new HashMap<>(); Map<String, Object> userInfos = new HashMap<>();
...@@ -316,18 +312,14 @@ public class Cookie { ...@@ -316,18 +312,14 @@ public class Cookie {
* @throws BizException * @throws BizException
*/ */
public static String getString(String userInfo, String type) throws BizException { public static String getString(String userInfo, String type) throws BizException {
if (StringUtil.isEmpty(userInfo)) { if (StringUtil.isBlank(userInfo)) {
LOGGER.error("Cookie解析失败:userInfo==NULL");
throw BizException.COOKIE_IS_ILLICIT; throw BizException.COOKIE_IS_ILLICIT;
} }
try { try {
userInfo = URLDecoder.decode(userInfo, "UTF-8"); userInfo = URLDecoder.decode(userInfo, "UTF-8");
LOGGER.info("Cookie的内容如下:" + String.valueOf(userInfo)); LOGGER.info("Cookie的内容如下:{}", userInfo);
} catch (UnsupportedEncodingException e) {
LOGGER.error("Cookie解析失败:" + e.getMessage(), e);
throw new BizException(BizException.COOKIE_IS_ILLICIT);
} catch (Exception e) { } catch (Exception e) {
LOGGER.error("Cookie解析失败:" + e.getMessage(), e); LOGGER.error("Cookie解析失败:{}" , e.getMessage(), e);
throw new BizException(BizException.COOKIE_IS_ILLICIT); throw new BizException(BizException.COOKIE_IS_ILLICIT);
} }
String[] userInfoArry = userInfo.split("&"); String[] userInfoArry = userInfo.split("&");
...@@ -335,7 +327,7 @@ public class Cookie { ...@@ -335,7 +327,7 @@ public class Cookie {
if (userInfoArry[i].contains(type)) { if (userInfoArry[i].contains(type)) {
String[] ids = userInfoArry[i].split("="); String[] ids = userInfoArry[i].split("=");
String id = ids[ids.length - 1]; String id = ids[ids.length - 1];
return StringUtil.isEmpty(id) || "undefined".equalsIgnoreCase(id) || "null".equalsIgnoreCase(id) || type.equalsIgnoreCase(id)? null : id; return StringUtil.isBlank(id) || "undefined".equalsIgnoreCase(id) || "null".equalsIgnoreCase(id) || type.equalsIgnoreCase(id)? null : id;
} }
} }
return null; return null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment