| | |
| | | return false; |
| | | } |
| | | |
| | | /** |
| | | * ASCII码递增排序(剔除空值) |
| | | * @param params |
| | | * @return |
| | | */ |
| | | public static String getSignCheckContent(Map<String, String> params) { |
| | | if (params == null) { |
| | | return null; |
| | | } else { |
| | | StringBuilder content = new StringBuilder(); |
| | | List<String> keys = new ArrayList(params.keySet()); |
| | | Collections.sort(keys); |
| | | |
| | | for(int i = 0; i < keys.size(); ++i) { |
| | | String key = (String)keys.get(i); |
| | | String value = String.valueOf(params.get(key)); |
| | | if(StringUtils.isEmpty(value)){ |
| | | continue; |
| | | } |
| | | content.append(i == 0 ? "" : "&").append(key).append("=").append(value); |
| | | } |
| | | return content.toString(); |
| | | } |
| | | } |
| | | |
| | | } |