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); }