mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
[更新]修改微信模式兼容
This commit is contained in:
parent
48c5c2fd35
commit
06fa7570f7
@ -17,6 +17,7 @@ namespace app\wechat\controller;
|
|||||||
use controller\BasicAdmin;
|
use controller\BasicAdmin;
|
||||||
use service\LogService;
|
use service\LogService;
|
||||||
use service\WechatService;
|
use service\WechatService;
|
||||||
|
use think\Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信配置管理
|
* 微信配置管理
|
||||||
@ -44,13 +45,18 @@ class Config extends BasicAdmin
|
|||||||
{
|
{
|
||||||
if ($this->request->isGet()) {
|
if ($this->request->isGet()) {
|
||||||
$code = encode(url('@admin', '', true, true) . '#' . $this->request->url());
|
$code = encode(url('@admin', '', true, true) . '#' . $this->request->url());
|
||||||
|
try {
|
||||||
|
$info = WechatService::instance('config')->getConfig();
|
||||||
|
} catch (Exception $e) {
|
||||||
|
$info = [];
|
||||||
|
}
|
||||||
return $this->fetch('', [
|
return $this->fetch('', [
|
||||||
'title' => '微信接口配置',
|
'title' => '微信接口配置',
|
||||||
'appuri' => url("@wechat/api.push", '', true, true),
|
'appuri' => url("@wechat/api.push", '', true, true),
|
||||||
'appid' => $this->request->get('appid', sysconf('wechat_thr_appid')),
|
'appid' => $this->request->get('appid', sysconf('wechat_thr_appid')),
|
||||||
'appkey' => $this->request->get('appkey', sysconf('wechat_thr_appkey')),
|
'appkey' => $this->request->get('appkey', sysconf('wechat_thr_appkey')),
|
||||||
'authurl' => "http://wm.cuci.cc/wechat/api.push/auth/{$code}.html",
|
'authurl' => "http://wm.cuci.cc/wechat/api.push/auth/{$code}.html",
|
||||||
'wechat' => WechatService::instance('config')->getConfig(),
|
'wechat' => $info,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -69,9 +69,6 @@ class WechatService
|
|||||||
'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,
|
||||||
];
|
];
|
||||||
if (in_array(strtolower($name), ['wechat', 'config'])) {
|
|
||||||
$name = 'user';
|
|
||||||
}
|
|
||||||
$type = '\\WeChat\\' . ucfirst(strtolower($name));
|
$type = '\\WeChat\\' . ucfirst(strtolower($name));
|
||||||
return new $type($config);
|
return new $type($config);
|
||||||
case 'thr':
|
case 'thr':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user