|
|
@ -2,7 +2,7 @@ package com.fr.plugin.decision.transmission.decrypt; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.Base64; |
|
|
|
import com.fr.base.Base64; |
|
|
|
import com.fr.base.ServerConfig; |
|
|
|
import com.fr.base.ServerConfig; |
|
|
|
import com.fr.decision.fun.impl.AbstractTransmissionDecryptProvider; |
|
|
|
import com.fr.decision.fun.impl.AbstractTransmissionEncryptionProvider; |
|
|
|
import com.fr.decision.web.CommonComponent; |
|
|
|
import com.fr.decision.web.CommonComponent; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.plugin.transform.FunctionRecorder; |
|
|
|
import com.fr.plugin.transform.FunctionRecorder; |
|
|
@ -15,7 +15,7 @@ import com.fr.web.struct.Atom; |
|
|
|
* Created by Zed on 2020/2/11 |
|
|
|
* Created by Zed on 2020/2/11 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@FunctionRecorder |
|
|
|
@FunctionRecorder |
|
|
|
public class Base64Decrypt extends AbstractTransmissionDecryptProvider { |
|
|
|
public class Base64Encryption extends AbstractTransmissionEncryptionProvider { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public String decrypt(String encryptionInfo) { |
|
|
|
public String decrypt(String encryptionInfo) { |
|
|
@ -40,4 +40,15 @@ public class Base64Decrypt extends AbstractTransmissionDecryptProvider { |
|
|
|
return Base64Component.KEY; |
|
|
|
return Base64Component.KEY; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public String encrypt(String plainInfo) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
if (StringUtils.isNotEmpty(plainInfo)) { |
|
|
|
|
|
|
|
return Base64.encode(plainInfo.getBytes(ServerConfig.getInstance().getServerCharset())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return StringUtils.EMPTY; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |