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.
|
|
|
<?php
|
|
|
|
declare (strict_types=1);
|
|
|
|
|
|
|
|
namespace app\api\controller;
|
|
|
|
|
|
|
|
use cores\BaseController;
|
|
|
|
use think\db\exception\DataNotFoundException;
|
|
|
|
use think\db\exception\DbException;
|
|
|
|
use think\db\exception\ModelNotFoundException;
|
|
|
|
|
|
|
|
class Wxserver extends BaseController
|
|
|
|
{
|
|
|
|
public function index()
|
|
|
|
{
|
|
|
|
$ext_json['extAppid'] = '123456';
|
|
|
|
$ext_json['ext']['attr']['store_id'] = 1001;
|
|
|
|
$ext_json['window'] = [];
|
|
|
|
$data['ext_json'] = $ext_json;
|
|
|
|
return $this->renderSuccess($data);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function verifyTicket()
|
|
|
|
{
|
|
|
|
$xmlData = file_get_contents("php://input");
|
|
|
|
$obj = new \app\common\library\wxserver\Server();
|
|
|
|
$obj->getVerifyTicket($xmlData);
|
|
|
|
echo 'success';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @notes:授权回调
|
|
|
|
* @throws DataNotFoundException
|
|
|
|
* @throws DbException
|
|
|
|
* @throws ModelNotFoundException
|
|
|
|
* @author: wanghousheng
|
|
|
|
*/
|
|
|
|
public function redirect()
|
|
|
|
{
|
|
|
|
$authorization_code = $this->request->get('auth_code');
|
|
|
|
if ($authorization_code) {
|
|
|
|
$obj = new \app\common\library\wxserver\Server();
|
|
|
|
$obj->authorizationInfo($authorization_code);
|
|
|
|
}
|
|
|
|
echo 'success';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function callback($appid)
|
|
|
|
{
|
|
|
|
echo 'success';
|
|
|
|
}
|
|
|
|
}
|