You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.1 KiB
44 lines
1.1 KiB
5 years ago
|
package com.fr.plugin.decision.transmission.decrypt;
|
||
|
|
||
|
import com.fr.base.Base64;
|
||
|
import com.fr.base.ServerConfig;
|
||
|
import com.fr.decision.fun.impl.AbstractTransmissionDecryptProvider;
|
||
|
import com.fr.decision.web.CommonComponent;
|
||
|
import com.fr.log.FineLoggerFactory;
|
||
|
import com.fr.plugin.transform.FunctionRecorder;
|
||
|
import com.fr.stable.StringUtils;
|
||
|
import com.fr.web.struct.Atom;
|
||
|
|
||
|
/**
|
||
|
* @author Zed
|
||
|
* @version 10.0
|
||
|
* Created by Zed on 2020/2/11
|
||
|
*/
|
||
|
@FunctionRecorder
|
||
|
public class Base64Decrypt extends AbstractTransmissionDecryptProvider {
|
||
|
|
||
|
@Override
|
||
|
public String decrypt(String encryptionInfo) {
|
||
|
try {
|
||
|
if (StringUtils.isNotEmpty(encryptionInfo)) {
|
||
|
return new String(Base64.decode(encryptionInfo), ServerConfig.getInstance().getServerCharset());
|
||
|
}
|
||
|
} catch (Exception e) {
|
||
|
FineLoggerFactory.getLogger().error(e.getMessage(), e);
|
||
|
}
|
||
|
|
||
|
return StringUtils.EMPTY;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public Atom attach() {
|
||
|
return CommonComponent.KEY;
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
public Atom client() {
|
||
|
return Base64Component.KEY;
|
||
|
}
|
||
|
|
||
|
}
|