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.

55 lines
1.4 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<?php
namespace app\base\controller\wechat\api;
use app\BaseController;
use think\App;
use think\facade\Request;
class Base extends BaseController
{
protected $easyWechatWeixinConfig; //easywechat微信公众号配置文件
protected $wechatConfig; //公众平台配置
/**
* 公众平台配置
* @date 2020-07-23
*/
public function __construct(App $app)
{
parent::__construct($app);
$weixin_param = get_weixin_config();
$this->wechatConfig = $weixin_param;
$this->easyWechatWeixinConfig = [
'app_id' => $weixin_param['app_id'],
'secret' => $weixin_param['app_secret'],
'token' => $weixin_param['token'],
'response_type' => 'array',
//日志 配置
'log' => [
'default' => 'dev', // 默认使用的 channel生产环境可以改为下面的 prod
'channels' => [
// 测试环境
'dev' => [
'driver' => 'daily',
'path' => root_path() . 'runtime/easywechat/easywechat.log',
'level' => 'debug',
'days' => 1
]
],
],
//OAuth 配置
'oauth' => [
'scopes' => ['snsapi_userinfo'],
// 'callback' => '/examples/oauth_callback.php',
],
];
}
}