feat: 添加 JWT 支持与开发环境配置,更新 API 路由与中间件
This commit is contained in:
34
app/Models/Player.php
Normal file
34
app/Models/Player.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/**
|
||||
* 主站玩家在本地映射账号(表 players),与 SSO JWT 中 site_code + site_player_id 对应。
|
||||
*/
|
||||
class Player extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'site_code',
|
||||
'site_player_id',
|
||||
'username',
|
||||
'nickname',
|
||||
'default_currency',
|
||||
'status',
|
||||
'last_login_at',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'last_login_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
public function wallets(): HasMany
|
||||
{
|
||||
return $this->hasMany(PlayerWallet::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user