feat: 开放API授权相关

This commit is contained in:
2025-05-20 14:40:39 +08:00
parent 970ff14c22
commit 7ffbc6d173
16 changed files with 577 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
<?php
declare (strict_types = 1);
namespace app\openapi\model;
use think\Model;
/**
* @mixin \think\Model
*/
class OAuthAccessTokenModel extends Model
{
// 表名
protected $name = 'oauth_access_token';
// 字段信息
protected $schema = [
'id' => 'int',
'client_id' => 'string',
'user_id' => 'int',
'access_token' => 'string',
'expires' => 'int',
'scope' => 'string',
'created_at' => 'datetime',
];
// access_token范围查询
public function scopeAccessToken($query, $access_token)
{
$query->where('access_token', '=', $access_token);
}
}