Commit 36eb86e7 authored by 曲欣亮's avatar 曲欣亮

修改签名算法

parent ae3fc6c3
package com.egolm.lang.config.interceptor; package com.egolm.lang.config.interceptor;
import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.TreeMap; import java.util.TreeMap;
...@@ -12,8 +13,17 @@ public class SigUtil { ...@@ -12,8 +13,17 @@ public class SigUtil {
Map<Object, Object> parameterMap = new TreeMap<Object, Object>(parameters); Map<Object, Object> parameterMap = new TreeMap<Object, Object>(parameters);
parameterMap.remove("sig"); parameterMap.remove("sig");
String queryString = HttpUtil.formatToQueryString(parameterMap); String queryString = HttpUtil.formatToQueryString(parameterMap);
String vsig = StringUtil.toMD5HexString(queryString); String vsig = StringUtil.toMD5HexString(queryString + secret);
return vsig; return vsig;
} }
public static void main(String[] args) {
String appid = "44EB5B79174D45F48BF32C09E6F0C4AA";
String secret = "4117B10F6D48494595EE5D567333BB32";
Map<String, Object> map = new HashMap<String, Object>();
map.put("appid", appid);
map.put("sDocument", "请刷银行卡");
map.put("sLink", "APOS/BankCardForm");
String sig = sig(map, secret);
System.out.println(sig);
}
} }
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