You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.0 KiB
37 lines
1.0 KiB
<?php
|
|
|
|
|
|
defined('IN_IA') or exit('Access Denied');
|
|
$dos = array('receive', '');
|
|
$do = in_array($do, $dos) ? $do : '';
|
|
|
|
$_W['uniacid'] = intval($_GPC['i']);
|
|
|
|
if (empty($_W['uniacid'])) {
|
|
iajax(1, '请先指定公众号');
|
|
}
|
|
$_W['account'] = uni_fetch($_W['uniacid']);
|
|
|
|
if ('receive' == $do) {
|
|
ignore_user_abort(true);
|
|
set_time_limit(30);
|
|
|
|
$modulename = $_GPC['modulename'];
|
|
$request = json_decode(html_entity_decode($_GPC['request']), true);
|
|
$response = json_decode(html_entity_decode($_GPC['response']), true);
|
|
$message = json_decode(html_entity_decode($_GPC['message']), true);
|
|
|
|
$module = module_fetch($modulename);
|
|
if (!empty($module)) {
|
|
$module_receiver = WeUtility::createModuleReceiver($modulename);
|
|
$module_receiver->message = $message;
|
|
$module_receiver->params = $request;
|
|
$module_receiver->response = $response;
|
|
$module_receiver->keyword = $request['keyword'];
|
|
$module_receiver->module = $module;
|
|
$module_receiver->uniacid = $_W['uniacid'];
|
|
if (method_exists($module_receiver, 'receive')) {
|
|
@$module_receiver->receive();
|
|
}
|
|
}
|
|
}
|