mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 03:25:12 +08:00
支付宝参数设置
This commit is contained in:
@@ -127,6 +127,11 @@ public class Constants {
|
||||
|
||||
public static final String ZERO_THREE = "03";
|
||||
|
||||
/**
|
||||
* RSA2签名算法
|
||||
*/
|
||||
public static final String RSA2 = "RSA2";
|
||||
|
||||
/**
|
||||
* UTF-8 字符集
|
||||
*/
|
||||
@@ -137,15 +142,24 @@ public class Constants {
|
||||
*/
|
||||
public static final String GBK = "GBK";
|
||||
|
||||
/**
|
||||
* URL分隔符
|
||||
*/
|
||||
public static final String URL_DELIMITER = "://";
|
||||
|
||||
public static final String HTTP = "http";
|
||||
|
||||
public static final String HTTPS = "https";
|
||||
|
||||
/**
|
||||
* http请求
|
||||
*/
|
||||
public static final String HTTP = "http://";
|
||||
public static final String HTTP_PREFIX = HTTP + URL_DELIMITER;
|
||||
|
||||
/**
|
||||
* https请求
|
||||
*/
|
||||
public static final String HTTPS = "https://";
|
||||
public static final String HTTPS_PREFIX = HTTPS + URL_DELIMITER;
|
||||
|
||||
/**
|
||||
* 通用成功标识
|
||||
|
||||
@@ -224,7 +224,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
||||
* @return 结果
|
||||
*/
|
||||
public static boolean isHttp(String link) {
|
||||
return StringUtils.startsWithAny(link, Constants.HTTP, Constants.HTTPS);
|
||||
return StringUtils.startsWithAny(link, Constants.HTTP_PREFIX, Constants.HTTPS_PREFIX);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -234,10 +234,10 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
||||
*/
|
||||
public static String removeHttp(String link) {
|
||||
String result;
|
||||
if (StringUtils.startsWith(link, Constants.HTTP)) {
|
||||
result = link.replace(Constants.HTTP, "");
|
||||
} else if (StringUtils.startsWith(link, Constants.HTTPS)) {
|
||||
result = link.replace(Constants.HTTPS, "");
|
||||
if (StringUtils.startsWith(link, Constants.HTTP_PREFIX)) {
|
||||
result = link.replace(Constants.HTTP_PREFIX, "");
|
||||
} else if (StringUtils.startsWith(link, Constants.HTTPS_PREFIX)) {
|
||||
result = link.replace(Constants.HTTPS_PREFIX, "");
|
||||
} else {
|
||||
result = link;
|
||||
}
|
||||
@@ -604,4 +604,17 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This method removes '://' from the given URL string.
|
||||
*
|
||||
* @param url the URL string to be processed
|
||||
* @return the processed URL string without '://'
|
||||
*/
|
||||
public static String removeDelimiter(String url) {
|
||||
if (url == null) {
|
||||
return null;
|
||||
}
|
||||
return url.replace(Constants.URL_DELIMITER, "");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user