mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-06 03:58:04 +08:00
修改微信配置
This commit is contained in:
parent
3dff96d8b7
commit
73fd404c23
@ -39,12 +39,6 @@ class Config extends Controller
|
|||||||
$this->_applyFormToken();
|
$this->_applyFormToken();
|
||||||
$this->thrNotify = url('@wechat/api.push', [], false, true)->build();
|
$this->thrNotify = url('@wechat/api.push', [], false, true)->build();
|
||||||
if ($this->request->isGet()) {
|
if ($this->request->isGet()) {
|
||||||
$this->title = '微信授权绑定';
|
|
||||||
$this->geoip = $this->app->cache->get('mygeoip', '');
|
|
||||||
if (empty($this->geoip)) {
|
|
||||||
$this->geoip = gethostbyname($this->request->host());
|
|
||||||
$this->app->cache->set('mygeoip', $this->geoip, 360);
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
$source = enbase64url(url('@admin', [], false, true) . '#' . $this->request->url());
|
$source = enbase64url(url('@admin', [], false, true) . '#' . $this->request->url());
|
||||||
$this->authurl = "http://open.cuci.cc/service/api.push/auth?source={$source}";
|
$this->authurl = "http://open.cuci.cc/service/api.push/auth?source={$source}";
|
||||||
@ -58,6 +52,12 @@ class Config extends Controller
|
|||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->wechat = [];
|
$this->wechat = [];
|
||||||
}
|
}
|
||||||
|
$this->geoip = $this->app->cache->get('mygeoip', '');
|
||||||
|
if (empty($this->geoip)) {
|
||||||
|
$this->geoip = gethostbyname($this->request->host());
|
||||||
|
$this->app->cache->set('mygeoip', $this->geoip, 360);
|
||||||
|
}
|
||||||
|
$this->title = '微信授权绑定';
|
||||||
$this->fetch();
|
$this->fetch();
|
||||||
} else {
|
} else {
|
||||||
foreach ($this->request->post() as $k => $v) sysconf($k, $v);
|
foreach ($this->request->post() as $k => $v) sysconf($k, $v);
|
||||||
@ -65,8 +65,7 @@ class Config extends Controller
|
|||||||
WechatService::ThinkAdminConfig()->setApiNotifyUri($this->thrNotify);
|
WechatService::ThinkAdminConfig()->setApiNotifyUri($this->thrNotify);
|
||||||
}
|
}
|
||||||
sysoplog('微信管理', '修改微信授权配置成功');
|
sysoplog('微信管理', '修改微信授权配置成功');
|
||||||
$uri = url('wechat/config/options');
|
$this->success('微信参数修改成功!');
|
||||||
$this->success('微信参数修改成功!', url('@admin') . "#{$uri}");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
{block name='script'}
|
{block name='script'}
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
apply('{:sysconf("wechat.type")}');
|
apply('{:sysconf("wechat.type")}' || 'api');
|
||||||
window.form.render();
|
window.form.render();
|
||||||
window.form.on('radio(wechat_type)', function (data) {
|
window.form.on('radio(wechat_type)', function (data) {
|
||||||
apply(data.value);
|
apply(data.value);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user