1
0
mirror of synced 2026-04-21 00:48:37 +08:00

Merge branch 'dev' into remove-urlbuilder

This commit is contained in:
yadong.zhang
2019-07-18 08:21:13 -05:00
committed by GitHub
15 changed files with 375 additions and 19 deletions

View File

@@ -3,6 +3,7 @@ package me.zhyd.oauth.utils;
import cn.hutool.core.codec.Base64;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.http.HttpUtil;
import me.zhyd.oauth.exception.AuthException;
import javax.crypto.Mac;
@@ -82,6 +83,7 @@ public class GlobalAuthUtil {
return res;
}
public static String parseMapToString(Map<String, Object> params, boolean encode) {
List<String> paramList = new ArrayList<>();
params.forEach((k, v) -> {
@@ -94,6 +96,12 @@ public class GlobalAuthUtil {
});
return CollUtil.join(paramList, "&");
}
public static Map<String, Object> parseQueryToMap(String url) {
Map<String, Object> paramMap = new HashMap<>();
HttpUtil.decodeParamMap(url, "UTF-8").forEach(paramMap::put);
return paramMap;
}
public static boolean isHttpProtocol(String url) {
if (StringUtils.isEmpty(url)) {