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