[更新]修改服务接口

This commit is contained in:
Anyon 2018-03-13 19:41:38 +08:00
parent de52938bde
commit ebbfd75e11
3 changed files with 9 additions and 5 deletions

View File

@ -44,15 +44,14 @@ 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());
$assign = [ 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_appid')), 'appid' => $this->request->get('appid', sysconf('wechat_appid')),
'appkey' => $this->request->get('appkey', sysconf('wechat_appkey')), '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(), 'wechat' => WechatService::instance('config')->getConfig(),
]; ]);
return $this->fetch('', $assign);
} }
try { try {
sysconf('wechat_appid', $this->request->post('wechat_appid')); sysconf('wechat_appid', $this->request->post('wechat_appid'));

5
config/wechat.php Normal file
View File

@ -0,0 +1,5 @@
<?php
return [
'service_url' => 'http://service.thinkadmin.top',
];

View File

@ -57,7 +57,7 @@ class WechatService
{ {
list($appid, $appkey) = [sysconf('wechat_appid'), sysconf('wechat_appkey')]; list($appid, $appkey) = [sysconf('wechat_appid'), sysconf('wechat_appkey')];
$token = strtolower("{$name}-{$appid}-{$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]; $params = ['uri' => strtolower($name), 'location' => $location, 'trace' => true];
return new SoapService(null, $params); return new SoapService(null, $params);
} }