easyWeChat 驗證微信 token


<?php
namespace app\index\controller;

use EasyWeChat\Factory;

class Index
{
    public function index()
    {
        $config = [
            'app_id' => 'wx90636672********',
            'secret' => '8c2391e3ccfabee663************',
            'token'   => '****',
            // 指定 API 調用返回結果的類型:array(default)/collection/object/raw/自定義類名
            'response_type' => 'array',

            'log' => [
                'level' => 'debug',
                'file' => __DIR__.'/../../wechat.log',
            ],
        ];

        $app = Factory::officialAccount($config);
        $response = $app->server->serve();
        $response->send(); // Laravel 里請使用:return $response;
    }
}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM