fix 自定义解密密文字符串当传入为空值时返回空字符串

This commit is contained in:
lijiarao
2022-02-16 17:04:52 +08:00
parent b2c95912e7
commit 47c7807095
@@ -1,5 +1,7 @@
package com.jero.common.util;
import org.apache.commons.lang3.StringUtils;
import java.security.Key;
import java.security.SecureRandom;
import javax.crypto.Cipher;
@@ -153,8 +155,12 @@ public class PasswordUtil {
* @throws Exception
*/
public static String decrypt(String ciphertext) {
if (StringUtils.isNotBlank(ciphertext)){
return decrypt(ciphertext, ALGORITHM, Salt);
}else {
return "";
}
return decrypt(ciphertext, ALGORITHM, Salt);
}
/**