搭建轻舟一期门户、后台和统一登录。
让分类、会员和示例工具共用同一账号,本地即可跑通登录与授权。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class OauthClient extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'name', 'client_id', 'secret_hash', 'redirect_uris', 'logout_uris', 'tool_id',
|
||||
'is_first_party', 'is_public', 'status',
|
||||
];
|
||||
|
||||
protected $hidden = ['secret_hash'];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'redirect_uris' => 'array',
|
||||
'logout_uris' => 'array',
|
||||
'is_first_party' => 'boolean',
|
||||
'is_public' => 'boolean',
|
||||
];
|
||||
}
|
||||
|
||||
public function tool(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Tool::class);
|
||||
}
|
||||
|
||||
public function allowsRedirect(string $uri): bool
|
||||
{
|
||||
return in_array($uri, $this->redirect_uris ?? [], true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user