|
@@ -6,11 +6,13 @@ use Catch\Base\CatchController;
|
|
use EasyWeChat\OpenPlatform\Application;
|
|
use EasyWeChat\OpenPlatform\Application;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
+use Illuminate\Support\Facades\Redis;
|
|
use Modules\Channel\Models\WechatAuthorizationInfo;
|
|
use Modules\Channel\Models\WechatAuthorizationInfo;
|
|
use Modules\Channel\Services\WechatOpenPlatform\WechatOpenPlatformService;
|
|
use Modules\Channel\Services\WechatOpenPlatform\WechatOpenPlatformService;
|
|
use Modules\Common\Errors\Errors;
|
|
use Modules\Common\Errors\Errors;
|
|
use Modules\Common\Exceptions\CommonBusinessException;
|
|
use Modules\Common\Exceptions\CommonBusinessException;
|
|
use Modules\User\Http\Controllers\UserTrait;
|
|
use Modules\User\Http\Controllers\UserTrait;
|
|
|
|
+use Symfony\Component\Cache\Adapter\RedisAdapter;
|
|
|
|
|
|
class WechatOpenPlatformController extends CatchController
|
|
class WechatOpenPlatformController extends CatchController
|
|
{
|
|
{
|
|
@@ -56,6 +58,7 @@ class WechatOpenPlatformController extends CatchController
|
|
public function authorCommand(Request $request, $component_appid) {
|
|
public function authorCommand(Request $request, $component_appid) {
|
|
$componentInfo = WechatOpenPlatformService::getComponentInfoByAppid($component_appid);
|
|
$componentInfo = WechatOpenPlatformService::getComponentInfoByAppid($component_appid);
|
|
$app = WechatOpenPlatformService::buildApplication($componentInfo);
|
|
$app = WechatOpenPlatformService::buildApplication($componentInfo);
|
|
|
|
+ $app->setCache(new RedisAdapter(Redis::client()));
|
|
$server = $app->getServer();
|
|
$server = $app->getServer();
|
|
|
|
|
|
$server->handleAuthorized(function($message, \Closure $next) {
|
|
$server->handleAuthorized(function($message, \Closure $next) {
|