mirror of
https://github.com/v2board/v2board.git
synced 2025-01-30 18:19:12 +08:00
update
This commit is contained in:
parent
aabd80ee9e
commit
8e0897f89d
@ -37,6 +37,9 @@ class UserController extends Controller
|
||||
if (User::where('email', $request->input('email')->first())) {
|
||||
abort(500, '邮箱已被使用');
|
||||
}
|
||||
if ($request->input('id') && !$request->input('password')) {
|
||||
abort(500, '密码不能为空');
|
||||
}
|
||||
$user->email = $request->input('email');
|
||||
$user->password = password_hash($request->input('password'), PASSWORD_DEFAULT);
|
||||
$user->transfer_enable = $request->input('transfer_enable') * 1073741824;
|
||||
|
@ -4,7 +4,7 @@ namespace App\Http\Requests\Admin;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ServerSave extends FormRequest
|
||||
class UserSave extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
@ -15,7 +15,6 @@ class ServerSave extends FormRequest
|
||||
{
|
||||
return [
|
||||
'email' => 'required|email',
|
||||
'password' => 'required',
|
||||
'transfer_enable' => 'numeric',
|
||||
'expired_at' => 'integer',
|
||||
'banned' => 'required|in:0,1',
|
||||
@ -28,7 +27,6 @@ class ServerSave extends FormRequest
|
||||
return [
|
||||
'email.required' => '邮箱不能为空',
|
||||
'email.email' => '邮箱格式不正确',
|
||||
'password.required' => '密码不能为空',
|
||||
'transfer_enable.numeric' => '流量格式不正确',
|
||||
'expired_at.integer' => '到期时间格式不正确',
|
||||
'banned.required' => '是否封禁不能为空',
|
||||
|
Loading…
Reference in New Issue
Block a user