1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace app\common\library;
- use EasyWeChat\Factory;
- use fast\Random;
- use think\Hook;
- /**
- * 短信验证码类
- */
- class WxPublic
- {
- /** @var \EasyWeChat\OfficialAccount\Application $app */
- protected $app;
- /**
- * WxpLogin constructor.
- */
- public function __construct()
- {
- $this->app=Factory::officialAccount([
- 'app_id'=>config('site.user_appid'),
- 'secret'=>config('site.user_appsecret'),
- 'log' => [
- 'level' => 'debug',
- 'file' => RUNTIME_PATH.'/wxp/wechat.log',
- ],
- 'oauth' => [
- 'scopes' => ['snsapi_userinfo'],
- 'callback' => '/index/user/wxp_handle',
- ],
- ]);
- }
- /**
- * @return \EasyWeChat\OfficialAccount\Application
- */
- public function getApp()
- {
- return $this->app;
- }
- }
|