修正输入值的必填规则

This commit is contained in:
EasyChen 2022-01-24 19:11:00 +08:00
parent 3c5108da72
commit ff21e69382
4 changed files with 16 additions and 15 deletions

View File

@ -22,9 +22,9 @@ class PushDeerDeviceController extends Controller
{ {
$validated = $request->validate( $validated = $request->validate(
[ [
'name' => 'string', 'name' => 'string|required',
'device_id' => 'string', 'device_id' => 'string|required',
'is_clip' => 'integer', 'is_clip' => 'integer|nullable',
'type' => 'string|nullable', 'type' => 'string|nullable',
] ]
); );
@ -55,8 +55,8 @@ class PushDeerDeviceController extends Controller
{ {
$validated = $request->validate( $validated = $request->validate(
[ [
'id' => 'integer', 'id' => 'integer|required',
'name' =>'string' 'name' =>'string|required'
] ]
); );
@ -75,7 +75,7 @@ class PushDeerDeviceController extends Controller
{ {
$validated = $request->validate( $validated = $request->validate(
[ [
'id' => 'integer', 'id' => 'integer|required',
] ]
); );

View File

@ -40,8 +40,8 @@ class PushDeerKeyController extends Controller
{ {
$validated = $request->validate( $validated = $request->validate(
[ [
'id' => 'integer', 'id' => 'integer|required',
'name' =>'string' 'name' =>'string|required'
] ]
); );
@ -60,7 +60,7 @@ class PushDeerKeyController extends Controller
{ {
$validated = $request->validate( $validated = $request->validate(
[ [
'id' => 'integer', 'id' => 'integer|required',
] ]
); );
@ -79,7 +79,7 @@ class PushDeerKeyController extends Controller
{ {
$validated = $request->validate( $validated = $request->validate(
[ [
'id' => 'integer', 'id' => 'integer|required',
] ]
); );

View File

@ -96,7 +96,7 @@ class PushDeerMessageController extends Controller
{ {
$validated = $request->validate( $validated = $request->validate(
[ [
'id' => 'integer', 'id' => 'integer|required',
] ]
); );

View File

@ -60,7 +60,7 @@ class PushDeerUserController extends Controller
{ {
$validated = $request->validate( $validated = $request->validate(
[ [
'code' => 'string', 'code' => 'string|required',
] ]
); );
@ -115,7 +115,7 @@ class PushDeerUserController extends Controller
{ {
$validated = $request->validate( $validated = $request->validate(
[ [
'idToken' => 'string', 'idToken' => 'string|required',
] ]
); );
@ -157,11 +157,12 @@ class PushDeerUserController extends Controller
{ {
$validated = $request->validate( $validated = $request->validate(
[ [
'tokenorcode' => 'string', 'tokenorcode' => 'string|required',
'type' => 'string', // apple or wechat 'type' => 'string|required', // apple or wechat
] ]
); );
$type_field = strtolower($validated['type']) == 'apple' ? 'apple_id' : 'wechat_id'; $type_field = strtolower($validated['type']) == 'apple' ? 'apple_id' : 'wechat_id';
$identiy_string = false; $identiy_string = false;