From ebbfd75e119a0234cade298c89982a7c821ad966 Mon Sep 17 00:00:00 2001 From: Anyon Date: Tue, 13 Mar 2018 19:41:38 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E4=BF=AE=E6=94=B9=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/wechat/controller/Config.php | 7 +++---- config/wechat.php | 5 +++++ extend/service/WechatService.php | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 config/wechat.php diff --git a/application/wechat/controller/Config.php b/application/wechat/controller/Config.php index caacc43ee..a2598292b 100644 --- a/application/wechat/controller/Config.php +++ b/application/wechat/controller/Config.php @@ -44,15 +44,14 @@ class Config extends BasicAdmin { if ($this->request->isGet()) { $code = encode(url('@admin', '', true, true) . '#' . $this->request->url()); - $assign = [ + return $this->fetch('', [ 'title' => '微信接口配置', 'appuri' => url("@wechat/api.push", '', true, true), 'appid' => $this->request->get('appid', sysconf('wechat_appid')), 'appkey' => $this->request->get('appkey', sysconf('wechat_appkey')), - 'authurl' => "http://wm.cuci.cc/wechat/api.push/auth/{$code}.html", + 'authurl' => config('wechat.service_url') . "/wechat/api.push/auth/redirect/{$code}.html", 'wechat' => WechatService::instance('config')->getConfig(), - ]; - return $this->fetch('', $assign); + ]); } try { sysconf('wechat_appid', $this->request->post('wechat_appid')); diff --git a/config/wechat.php b/config/wechat.php new file mode 100644 index 000000000..392be7b1b --- /dev/null +++ b/config/wechat.php @@ -0,0 +1,5 @@ + 'http://service.thinkadmin.top', +]; \ No newline at end of file diff --git a/extend/service/WechatService.php b/extend/service/WechatService.php index 9382197c9..5aaff0c6d 100644 --- a/extend/service/WechatService.php +++ b/extend/service/WechatService.php @@ -57,7 +57,7 @@ class WechatService { list($appid, $appkey) = [sysconf('wechat_appid'), sysconf('wechat_appkey')]; $token = strtolower("{$name}-{$appid}-{$appkey}"); - $location = "http://service.thinkadmin.top/wechat/api.client/soap/{$token}.html"; + $location = config('wechat.service_url') . "/wechat/api.client/soap/{$token}.html"; $params = ['uri' => strtolower($name), 'location' => $location, 'trace' => true]; return new SoapService(null, $params); }