登录提交信息加密,新增Base64的支持
This commit is contained in:
@@ -25,6 +25,9 @@ public class DesUtils {
|
||||
if (StringUtils.isBlank(data)){
|
||||
return "";
|
||||
}
|
||||
if ("Base64".equals(secretKey)) {
|
||||
return EncodeUtils.encodeBase64(data);
|
||||
}
|
||||
String[] ks = StringUtils.split(secretKey, ",");
|
||||
if (ks.length >= 3){
|
||||
return desCore.strEnc(data, ks[0], ks[1], ks[2]);
|
||||
@@ -39,6 +42,9 @@ public class DesUtils {
|
||||
if (StringUtils.isBlank(data)){
|
||||
return "";
|
||||
}
|
||||
if ("Base64".equals(secretKey)) {
|
||||
return EncodeUtils.decodeBase64String(data);
|
||||
}
|
||||
String[] ks = StringUtils.split(secretKey, ",");
|
||||
if (ks.length >= 3){
|
||||
return desCore.strDec(data, ks[0], ks[1], ks[2]);
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
*/
|
||||
this.DesUtils.encode = function(data, secretKey){
|
||||
if (data && secretKey){
|
||||
if (secretKey === 'Base64'){
|
||||
return Base64.encode(data);
|
||||
}
|
||||
var ks = secretKey.split(',');
|
||||
if (ks.length >= 3){
|
||||
return strEnc(data, ks[0], ks[1], ks[2]);
|
||||
@@ -32,6 +35,9 @@
|
||||
*/
|
||||
this.DesUtils.decode = function(data, secretKey){
|
||||
if (data && secretKey){
|
||||
if (secretKey === 'Base64'){
|
||||
return Base64.decode(data);
|
||||
}
|
||||
var ks = secretKey.split(',');
|
||||
if (ks.length >= 3){
|
||||
return strDec(data, ks[0], ks[1], ks[2]);
|
||||
|
||||
Reference in New Issue
Block a user