init 问题
This commit is contained in:
parent
3d46fdfe7f
commit
71e4b0bffa
|
|
@ -69,26 +69,26 @@ public class AlipayUtil {
|
||||||
// @Value("${alipay.account.publicKey}")
|
// @Value("${alipay.account.publicKey}")
|
||||||
private String accountPublicKey;
|
private String accountPublicKey;
|
||||||
|
|
||||||
@PostConstruct
|
// @PostConstruct
|
||||||
private void init() {
|
// private void init() {
|
||||||
CzgResult<SysParamsDTO> aliGateway = sysParamsService.getParamsByCode("ali_gateway");
|
// CzgResult<SysParamsDTO> aliGateway = sysParamsService.getParamsByCode("ali_gateway");
|
||||||
CzgResult<SysParamsDTO> aliMiniAppId = sysParamsService.getParamsByCode("ali_mini_app_id");
|
// CzgResult<SysParamsDTO> aliMiniAppId = sysParamsService.getParamsByCode("ali_mini_app_id");
|
||||||
CzgResult<SysParamsDTO> aliMiniPrivateKey = sysParamsService.getParamsByCode("ali_mini_private_key");
|
// CzgResult<SysParamsDTO> aliMiniPrivateKey = sysParamsService.getParamsByCode("ali_mini_private_key");
|
||||||
CzgResult<SysParamsDTO> aliMiniPublicKey = sysParamsService.getParamsByCode("ali_mini_public_key");
|
// CzgResult<SysParamsDTO> aliMiniPublicKey = sysParamsService.getParamsByCode("ali_mini_public_key");
|
||||||
CzgResult<SysParamsDTO> aliAccountAppId = sysParamsService.getParamsByCode("ali_account_app_id");
|
// CzgResult<SysParamsDTO> aliAccountAppId = sysParamsService.getParamsByCode("ali_account_app_id");
|
||||||
CzgResult<SysParamsDTO> aliAccountPrivateKey = sysParamsService.getParamsByCode("ali_account_private_key");
|
// CzgResult<SysParamsDTO> aliAccountPrivateKey = sysParamsService.getParamsByCode("ali_account_private_key");
|
||||||
CzgResult<SysParamsDTO> aliAccountPublicKey = sysParamsService.getParamsByCode("ali_account_public_key");
|
// CzgResult<SysParamsDTO> aliAccountPublicKey = sysParamsService.getParamsByCode("ali_account_public_key");
|
||||||
CzgResult<SysParamsDTO> aliEncryptKey = sysParamsService.getParamsByCode("ali_encrypt_key");
|
// CzgResult<SysParamsDTO> aliEncryptKey = sysParamsService.getParamsByCode("ali_encrypt_key");
|
||||||
serverUrl = aliGateway.getData().getParamValue();
|
// serverUrl = aliGateway.getData().getParamValue();
|
||||||
appId = aliMiniAppId.getData().getParamValue();
|
// appId = aliMiniAppId.getData().getParamValue();
|
||||||
privateKey = aliMiniPrivateKey.getData().getParamValue();
|
// privateKey = aliMiniPrivateKey.getData().getParamValue();
|
||||||
alipayPublicKey = aliMiniPublicKey.getData().getParamValue();
|
// alipayPublicKey = aliMiniPublicKey.getData().getParamValue();
|
||||||
encryptKey = aliEncryptKey.getData().getParamValue();
|
// encryptKey = aliEncryptKey.getData().getParamValue();
|
||||||
accountAppId = aliAccountAppId.getData().getParamValue();
|
// accountAppId = aliAccountAppId.getData().getParamValue();
|
||||||
accountPrivateKey = aliAccountPrivateKey.getData().getParamValue();
|
// accountPrivateKey = aliAccountPrivateKey.getData().getParamValue();
|
||||||
accountPublicKey = aliAccountPublicKey.getData().getParamValue();
|
// accountPublicKey = aliAccountPublicKey.getData().getParamValue();
|
||||||
log.info("支付宝工具类初始化成功, {}", this);
|
// log.info("支付宝工具类初始化成功, {}", this);
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建支付宝客户端
|
* 创建支付宝客户端
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
package com.czg.service.account.util;
|
package com.czg.service.account.util;
|
||||||
|
|
||||||
import cn.hutool.core.codec.Base64;
|
import cn.hutool.core.codec.Base64;
|
||||||
import cn.hutool.core.io.IoUtil;
|
|
||||||
import cn.hutool.core.util.IdUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.crypto.symmetric.AES;
|
import cn.hutool.crypto.symmetric.AES;
|
||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
|
|
@ -21,7 +19,6 @@ import jakarta.validation.constraints.NotBlank;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
@ -71,18 +68,18 @@ public class WechatAuthUtil {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
// @PostConstruct
|
||||||
public void init() {
|
// public void init() {
|
||||||
CzgResult<SysParamsDTO> wxMiniAppId = sysParamsService.getParamsByCode("wx_mini_app_id");
|
// CzgResult<SysParamsDTO> wxMiniAppId = sysParamsService.getParamsByCode("wx_mini_app_id");
|
||||||
CzgResult<SysParamsDTO> wxMiniSecrete = sysParamsService.getParamsByCode("wx_mini_secrete");
|
// CzgResult<SysParamsDTO> wxMiniSecrete = sysParamsService.getParamsByCode("wx_mini_secrete");
|
||||||
CzgResult<SysParamsDTO> wxAccountAppId = sysParamsService.getParamsByCode("wx_account_app_id");
|
// CzgResult<SysParamsDTO> wxAccountAppId = sysParamsService.getParamsByCode("wx_account_app_id");
|
||||||
CzgResult<SysParamsDTO> wxAccountSecrete = sysParamsService.getParamsByCode("wx_account_secrete");
|
// CzgResult<SysParamsDTO> wxAccountSecrete = sysParamsService.getParamsByCode("wx_account_secrete");
|
||||||
appId = wxMiniAppId.getData().getParamValue();
|
// appId = wxMiniAppId.getData().getParamValue();
|
||||||
secrete = wxMiniSecrete.getData().getParamValue();
|
// secrete = wxMiniSecrete.getData().getParamValue();
|
||||||
accountAppId = wxAccountAppId.getData().getParamValue();
|
// accountAppId = wxAccountAppId.getData().getParamValue();
|
||||||
accountSecrete = wxAccountSecrete.getData().getParamValue();
|
// accountSecrete = wxAccountSecrete.getData().getParamValue();
|
||||||
log.info("微信工具类初始化成功, appId: {}, secrete: {}, accountAppId: {}, accountSecrete: {}", appId, secrete, accountAppId, accountSecrete);
|
// log.info("微信工具类初始化成功, appId: {}, secrete: {}, accountAppId: {}, accountSecrete: {}", appId, secrete, accountAppId, accountSecrete);
|
||||||
}
|
// }
|
||||||
|
|
||||||
public String getAccountOpenId(String code) {
|
public String getAccountOpenId(String code) {
|
||||||
String requestUrl = "https://api.weixin.qq.com/sns/oauth2/access_token?";
|
String requestUrl = "https://api.weixin.qq.com/sns/oauth2/access_token?";
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue