feat(admin): 增加玩家密码管理与角色边界
This commit is contained in:
@@ -251,6 +251,11 @@ final class AdminUser extends Authenticatable
|
||||
{
|
||||
$slugs = array_values(array_unique($slugs));
|
||||
\App\Support\SuperAdminAccount::assertNotSiteRoleAssignment($slugs);
|
||||
if (in_array(\App\Support\PlatformSystemRoles::SLUG_AGENT, $slugs, true)) {
|
||||
throw ValidationException::withMessages([
|
||||
'role_slugs' => [trans('admin.agent_role_not_assignable_to_platform_account')],
|
||||
]);
|
||||
}
|
||||
|
||||
$roleIds = DB::table('admin_roles')
|
||||
->where('scope_type', AdminRole::SCOPE_SYSTEM)
|
||||
|
||||
@@ -4,8 +4,8 @@ namespace App\Models;
|
||||
|
||||
use App\Support\PlayerAuthSource;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
/**
|
||||
* 主站玩家在本地映射账号(表 players),与 SSO JWT 中 site_code + site_player_id 对应。
|
||||
@@ -27,6 +27,7 @@ final class Player extends Model
|
||||
'last_login_at',
|
||||
'login_failed_count',
|
||||
'login_locked_until',
|
||||
'native_token_version',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
@@ -40,6 +41,7 @@ final class Player extends Model
|
||||
'last_login_at' => 'datetime',
|
||||
'login_failed_count' => 'integer',
|
||||
'login_locked_until' => 'datetime',
|
||||
'native_token_version' => 'integer',
|
||||
'risk_tags' => 'array',
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user