diff --git a/plugin/think-plugs-wechat/src/controller/Config.php b/plugin/think-plugs-wechat/src/controller/Config.php index 219d0f8b5..6e50aa7d7 100644 --- a/plugin/think-plugs-wechat/src/controller/Config.php +++ b/plugin/think-plugs-wechat/src/controller/Config.php @@ -18,7 +18,6 @@ declare (strict_types=1); namespace app\wechat\controller; -use app\wechat\service\PaymentService; use app\wechat\service\WechatService; use think\admin\Builder; use think\admin\Controller; @@ -147,11 +146,11 @@ class Config extends Controller if ($this->request->isGet()) { $this->title = '微信支付配置'; $local = LocalStorage::instance(); - $data = sysdata('plugin.wechat.payment'); - $this->mch_ssl_cer = $data['mch_ssl_cer'] ?? ''; - $this->mch_ssl_key = $data['mch_ssl_key'] ?? ''; - $this->mch_ssl_p12 = $data['mch_ssl_p12'] ?? ''; - $this->mch_ssl_pay = $data['mch_ssl_pay'] ?? ''; + $this->data = sysdata('plugin.wechat.payment'); + $this->mch_ssl_cer = $this->data['mch_ssl_cer'] ?? ''; + $this->mch_ssl_key = $this->data['mch_ssl_key'] ?? ''; + $this->mch_ssl_p12 = $this->data['mch_ssl_p12'] ?? ''; + $this->mch_ssl_pay = $this->data['mch_ssl_pay'] ?? ''; if (!$local->has($this->mch_ssl_cer, true)) $this->mch_ssl_cer = ''; if (!$local->has($this->mch_ssl_key, true)) $this->mch_ssl_key = ''; if (!$local->has($this->mch_ssl_p12, true)) $this->mch_ssl_p12 = ''; diff --git a/plugin/think-plugs-wechat/src/view/config/payment.html b/plugin/think-plugs-wechat/src/view/config/payment.html index e600781ba..f274acb8b 100644 --- a/plugin/think-plugs-wechat/src/view/config/payment.html +++ b/plugin/think-plugs-wechat/src/view/config/payment.html @@ -17,19 +17,19 @@ @@ -37,7 +37,7 @@ @@ -117,6 +117,6 @@ function apply(data) { return $('[data-mch-type="' + data.value + '"]').show().siblings('[data-mch-type]').hide(); } - })("{:sysconf('wechat.mch_ssl_type')}" || 'pem'); + })("{$data.mch_ssl_type|default='pem'}"); {/block}