开放平台全网发布失败

飞山雪豹

$openPlatform = Factory::openPlatform($config); // 替换应用中的缓存 // $openPlatform['cache'] = $cache; $server = $openPlatform->server;

   $msg = $server->getMessage();
   Log::error($msg);
    if ($msg['MsgType'] == 'text') {
        Log::error('文本总消息');
        if ($msg['Content'] == 'TESTCOMPONENT_MSG_TYPE_TEXT') {
            Log::error('文本分消息---------TESTCOMPONENT_MSG_TYPE_TEXT'.$msg['Content'].'_callback');

            echo  $openPlatform->encryptor ->encrypt($msg['Content'].'_callback');die;
        } else if ( strpos($msg['Content'], 'QUERY_AUTH_CODE') == 0) {
            echo '';
            Log::error('文本分消息---------TESTCOMPONENT_MSG_TYPE_TEXT');
            $code = substr($msg['Content'], 16);
            Log::error('以下为授权码原始信息');
            Log::error($openPlatform->handleAuthorize($code));
            $authorizerInfo = $openPlatform->handleAuthorize($code)['authorization_info'];
            Log::error('以下为授权码信息');
            Log::error($authorizerInfo);
            $curOfficialAccount = $openPlatform->officialAccount($authorizerInfo['authorizer_appid'], $authorizerInfo['authorizer_refresh_token']);
            Log::error('发送前'.$code . "_from_api");
            $curOfficialAccount->customer_service->message($code . "_from_api")->to($msg['FromUserName'])->send();
            Log::error('发送结束'.$msg['FromUserName']);
        }

    } else if ($msg['MsgType'] == 'event') {
        Log::error('事件消息---------event'.$msg['Event'].'from_callback');

        Log::error('加密后的'.$openPlatform->encryptor ->encrypt($msg['Event'].'from_callback'));
        echo  $openPlatform->encryptor ->encrypt($msg['Event'].'from_callback'); die;
    }else{
            $response = $server->serve();
            $response->send();
    }