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\response\Json;
|
|
|
|
|
|
|
|
class Wxserver extends BaseController
|
|
|
|
{
|
|
|
|
public function index(): Json
|
|
|
|
{
|
|
|
|
$obj = new \app\common\library\wxserver\Server();
|
|
|
|
$url = $this->request->domain(true) . '/api/wxserver/redirect';
|
|
|
|
$jumUrl = $obj->jumpH5Url($url);
|
|
|
|
return $this->renderSuccess(compact('jumUrl'));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function verifyTicket()
|
|
|
|
{
|
|
|
|
$xmlData = file_get_contents("php://input");
|
|
|
|
$obj = new \app\common\library\wxserver\Server();
|
|
|
|
$obj->getVerifyTicket($xmlData);
|
|
|
|
echo 'success';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function redirect()
|
|
|
|
{
|
|
|
|
$authorization_code = $this->request->param('authorization_code');
|
|
|
|
$expires_in = $this->request->param('expires_in');
|
|
|
|
if ($authorization_code) {
|
|
|
|
$obj = new \app\common\library\wxserver\Server();
|
|
|
|
$obj->authorizationInfo($authorization_code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|