mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
[更新]修改微信模式兼容
This commit is contained in:
parent
06fa7570f7
commit
6ce830f9a4
@ -16,6 +16,7 @@ namespace service;
|
|||||||
|
|
||||||
use app\wechat\service\FansService;
|
use app\wechat\service\FansService;
|
||||||
use function Couchbase\defaultDecoder;
|
use function Couchbase\defaultDecoder;
|
||||||
|
use think\Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信数据服务
|
* 微信数据服务
|
||||||
@ -64,13 +65,16 @@ class WechatService
|
|||||||
'appsecret' => sysconf('wechat_appsecret'),
|
'appsecret' => sysconf('wechat_appsecret'),
|
||||||
'encodingaeskey' => sysconf('wechat_encodingaeskey'),
|
'encodingaeskey' => sysconf('wechat_encodingaeskey'),
|
||||||
'mch_id' => sysconf('wechat_mch_id'),
|
'mch_id' => sysconf('wechat_mch_id'),
|
||||||
'partnerkey' => sysconf('wechat_partnerkey'),
|
'mch_key' => sysconf('wechat_partnerkey'),
|
||||||
'ssl_cer' => sysconf('wechat_cert_cert'),
|
'ssl_cer' => sysconf('wechat_cert_cert'),
|
||||||
'ssl_key' => sysconf('wechat_cert_key'),
|
'ssl_key' => sysconf('wechat_cert_key'),
|
||||||
'cachepath' => env('cache_path') . 'wechat' . DIRECTORY_SEPARATOR,
|
'cachepath' => env('cache_path') . 'wechat' . DIRECTORY_SEPARATOR,
|
||||||
];
|
];
|
||||||
$type = '\\WeChat\\' . ucfirst(strtolower($name));
|
$class = '\\WeChat\\' . ucfirst(strtolower($name));
|
||||||
return new $type($config);
|
if (class_exists($class)) {
|
||||||
|
return new $class($config);
|
||||||
|
}
|
||||||
|
throw new Exception("Class '{$class}' not found");
|
||||||
case 'thr':
|
case 'thr':
|
||||||
default:
|
default:
|
||||||
list($appid, $appkey) = [sysconf('wechat_thr_appid'), sysconf('wechat_thr_appkey')];
|
list($appid, $appkey) = [sysconf('wechat_thr_appid'), sysconf('wechat_thr_appkey')];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user