feat: 增强环境配置与开发服务,支持局域网访问及币种管理

This commit is contained in:
2026-05-21 16:24:41 +08:00
parent 699d43fbd4
commit 7a6048de10
60 changed files with 1321 additions and 443 deletions

View File

@@ -2,8 +2,8 @@
namespace App\Http\Requests\Admin;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use Illuminate\Foundation\Http\FormRequest;
/**
* 玩家更新请求。
@@ -22,7 +22,18 @@ final class AdminPlayerUpdateRequest extends FormRequest
return [
'username' => ['sometimes', 'string', 'max:128'],
'nickname' => ['sometimes', 'nullable', 'string', 'max:128'],
'default_currency' => ['sometimes', 'string', 'max:16', Rule::exists('currencies', 'code')],
'status' => ['sometimes', 'integer', Rule::in([0, 1, 2])],
];
}
protected function prepareForValidation(): void
{
if (! $this->has('default_currency')) {
return;
}
$code = strtoupper(substr(trim((string) $this->input('default_currency')), 0, 16));
$this->merge(['default_currency' => $code]);
}
}