修改第三方平台

This commit is contained in:
Anyon 2019-12-09 14:21:49 +08:00
parent b3704611fb
commit cbe09a951b
3 changed files with 14 additions and 12 deletions

View File

@ -19,6 +19,7 @@ use app\service\handle\PublishHandle;
use app\service\handle\ReceiveHandle;
use app\service\service\WechatService;
use think\admin\Controller;
use think\admin\service\SystemService;
use WeOpen\Service;
/**
@ -39,13 +40,14 @@ class Push extends Controller
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function notify($appid)
public function notify($appid = '')
{
$appid = empty($appid) ? input('appid') : $appid;
if (in_array($appid, ['wx570bc396a51b8ff8', 'wxd101a85aa106f53e'])) {
# 全网发布接口测试
return PublishHandle::instance()->handler($appid);
} else {
# 接口正常服务
# 常归接口正常服务
return ReceiveHandle::instance()->handler($appid);
}
}
@ -166,7 +168,7 @@ class Push extends Controller
}
// 重新通过接口查询公众号参数
if (!($update = array_merge($result, $service->getAuthorizerInfo($result['authorizer_appid'])))) {
return '获取授权数据失败, 请稍候再试!';
return '获取授权数据失败, 请稍候再试! ';
}
// 生成公众号授权参数
$update = array_merge($this->buildAuthData($update), [
@ -175,7 +177,7 @@ class Push extends Controller
// 微信接口APPKEY处理与更新
$config = $this->app->db->name('WechatServiceConfig')->where(['authorizer_appid' => $result['authorizer_appid']])->find();
$update['appkey'] = empty($config['appkey']) ? md5(uniqid('', true)) : $config['appkey'];
data_save('WechatServiceConfig', $update, 'authorizer_appid');
SystemService::instance()->save('WechatServiceConfig', $update, 'authorizer_appid');
if (!empty($redirect)) { // 带上appid与appkey跳转到应用
$split = stripos($redirect, '?') > 0 ? '&' : '?';
$realurl = preg_replace(['/appid=\w+/i', '/appkey=\w+/i', '/(\?\&)$/i'], ['', '', ''], $redirect);

View File

@ -10,7 +10,7 @@
{block name="content"}
<div class="think-box-shadow">
{include file='index/index_search'}
{include file='wechat/index_search'}
<table class="layui-table margin-top-10" lay-skin="line">
{notempty name='list'}
<thead>

View File

@ -7,14 +7,14 @@
<div class="layui-form-item layui-inline">
<label class="layui-form-label">微信标识</label>
<div class="layui-input-inline">
<input name="authorizer_appid" value="{$Think.get.authorizer_appid|default=''}" placeholder="请输入微信APPID" class="layui-input">
<input name="authorizer_appid" value="{:input('authorizer_appid','')}" placeholder="请输入微信APPID" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">微信名称</label>
<div class="layui-input-inline">
<input name="nick_name" value="{$Think.get.nick_name|default=''}" placeholder="请输入微信名称" class="layui-input">
<input name="nick_name" value="{:input('nick_name','')}" placeholder="请输入微信名称" class="layui-input">
</div>
</div>
@ -24,7 +24,7 @@
<select name="service_type" class="layui-select">
<option value="">- 全部 -</option>
{foreach ['0'=>'显示订阅号类型','2'=>'显示服务号类型','3'=>'显示小程序类型'] as $k=>$v}
<!--{if $k.'' eq $Think.get.service_type}-->
<!--{if $k.'' eq input('service_type','')}-->
<option selected value="{$k}">{$v}</option>
<!--{else}-->
<option value="{$k}">{$v}</option>
@ -39,11 +39,11 @@
<div class="layui-input-inline">
<select class="layui-select" name="status">
{foreach [''=>'- 全部 -','0'=>'已禁用的账号','1'=>'使用中的账号'] as $k=>$v}
{eq name='Think.get.status' value='$k.""'}
{if input('status') eq $k}
<option selected value="{$k}">{$v}</option>
{else}
<option value="{$k}">{$v}</option>
{/eq}
{/if}
{/foreach}
</select>
</div>
@ -52,14 +52,14 @@
<div class="layui-form-item layui-inline">
<label class="layui-form-label">注册公司</label>
<div class="layui-input-inline">
<input name="principal_name" value="{$Think.get.principal_name|default=''}" placeholder="请输入注册公司" class="layui-input">
<input name="principal_name" value="{:input('principal_name','')}" placeholder="请输入注册公司" class="layui-input">
</div>
</div>
<div class="layui-form-item layui-inline">
<label class="layui-form-label">授权时间</label>
<div class="layui-input-inline">
<input data-date-range name="create_at" value="{$Think.get.create_at|default=''}" placeholder="请选择授权时间" class="layui-input">
<input data-date-range name="create_at" value="{:input('create_at','')}" placeholder="请选择授权时间" class="layui-input">
</div>
</div>