Files
2025-10-31 09:28:10 +08:00

62 lines
1.7 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的saas管理平台
// +----------------------------------------------------------------------
// | 官方网址https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\adminapi\controller\wxoplatform;
use app\service\admin\wxoplatform\OplatformService;
use core\base\BaseAdminController;
use think\Response;
class Oplatform extends BaseAdminController
{
/**
* 获取授权链接
* @description 获取授权链接
* @return Response
*/
public function getAuthorizationUrl()
{
return success(data: (new OplatformService())->createPreAuthorizationUrl());
}
/**
* 授权
* @description 授权
* @return Response
*/
public function authorization()
{
$data = $this->request->params([
['auth_code', ''],
['expires_in', ''],
]);
return success((new OplatformService())->authorization($data));
}
/**
* 授权
* @description 授权
* @return Response
*/
public function cancelAuthorization()
{
return success((new OplatformService())->cancelAuthorization());
}
public function getAuthRecord()
{
$data = $this->request->params([
['name', ''],
]);
return success((new OplatformService())->getAuthRecord($data));
}
}