fix 自定义解密密文字符串当传入为空值时返回空字符串
This commit is contained in:
+7
-1
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user