mirror of
https://github.com/v2board/v2board.git
synced 2024-11-10 17:49:11 +08:00
update: config
This commit is contained in:
parent
b740998760
commit
35362689c4
@ -265,4 +265,30 @@ class UserController extends Controller
|
|||||||
'data' => true
|
'data' => true
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setInviteUser(Request $request)
|
||||||
|
{
|
||||||
|
$request->validate([
|
||||||
|
'user_id' => 'required|integer',
|
||||||
|
'invite_user' => 'required',
|
||||||
|
], [
|
||||||
|
'user_id.required' => '用户ID不能为空',
|
||||||
|
'user_id.integer' => '用户ID参数有误',
|
||||||
|
'invite_user.required' => '邀请人不能为空'
|
||||||
|
]);
|
||||||
|
|
||||||
|
$user = User::find($request->input('user_id'));
|
||||||
|
if (!$user) abort(500, '用户不存在');
|
||||||
|
if (strpos($request->input('invite_user'), '@') !== -1) {
|
||||||
|
$inviteUser = User::where('email', $request->input('invite_user'))->first();
|
||||||
|
} else {
|
||||||
|
$inviteUser = User::find($request->input('invite_user'));
|
||||||
|
}
|
||||||
|
if (!$inviteUser) abort(500, '邀请人不存在');
|
||||||
|
$user->invite_user_id = $inviteUser->id;
|
||||||
|
|
||||||
|
return response([
|
||||||
|
'data' => $user->save()
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -120,7 +120,8 @@ class ConfigSave extends FormRequest
|
|||||||
// illiteracy prompt
|
// illiteracy prompt
|
||||||
return [
|
return [
|
||||||
'app_url.url' => '站点URL格式不正确,必须携带http(s)://',
|
'app_url.url' => '站点URL格式不正确,必须携带http(s)://',
|
||||||
'subscribe_url.url' => '订阅URL格式不正确,必须携带http(s)://'
|
'subscribe_url.url' => '订阅URL格式不正确,必须携带http(s)://',
|
||||||
|
'server_token.min' => '通讯密钥长度必须大于16位'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,6 +74,7 @@ class AdminRoute
|
|||||||
$router->post('/user/sendMail', 'Admin\\UserController@sendMail');
|
$router->post('/user/sendMail', 'Admin\\UserController@sendMail');
|
||||||
$router->post('/user/ban', 'Admin\\UserController@ban');
|
$router->post('/user/ban', 'Admin\\UserController@ban');
|
||||||
$router->post('/user/resetSecret', 'Admin\\UserController@resetSecret');
|
$router->post('/user/resetSecret', 'Admin\\UserController@resetSecret');
|
||||||
|
$router->post('/user/setInviteUser', 'Admin\\UserController@setInviteUser');
|
||||||
// StatOrder
|
// StatOrder
|
||||||
$router->get ('/stat/getOverride', 'Admin\\StatController@getOverride');
|
$router->get ('/stat/getOverride', 'Admin\\StatController@getOverride');
|
||||||
$router->get ('/stat/getServerLastRank', 'Admin\\StatController@getServerLastRank');
|
$router->get ('/stat/getServerLastRank', 'Admin\\StatController@getServerLastRank');
|
||||||
|
Loading…
Reference in New Issue
Block a user