mirror of
https://github.com/v2board/v2board.git
synced 2024-11-14 07:29:13 +08:00
update: fix payment update
This commit is contained in:
parent
37a6f3861c
commit
56c726b173
@ -41,7 +41,7 @@ class PaymentController extends Controller
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function save(PaymentSave $request)
|
public function save(Request $request)
|
||||||
{
|
{
|
||||||
if (!config('v2board.app_url')) {
|
if (!config('v2board.app_url')) {
|
||||||
abort(500, '请在站点配置中配置站点地址');
|
abort(500, '请在站点配置中配置站点地址');
|
||||||
@ -58,6 +58,15 @@ class PaymentController extends Controller
|
|||||||
'data' => true
|
'data' => true
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
$request->validate([
|
||||||
|
'name' => 'required',
|
||||||
|
'payment' => 'required',
|
||||||
|
'config' => 'required'
|
||||||
|
], [
|
||||||
|
'name.required' => '显示名称不能为空',
|
||||||
|
'payment.required' => '网关参数不能为空',
|
||||||
|
'config.required' => '配置参数不能为空'
|
||||||
|
]);
|
||||||
if (!Payment::create([
|
if (!Payment::create([
|
||||||
'name' => $request->input('name'),
|
'name' => $request->input('name'),
|
||||||
'payment' => $request->input('payment'),
|
'payment' => $request->input('payment'),
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Requests\Admin;
|
|
||||||
|
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
|
||||||
|
|
||||||
class PaymentSave extends FormRequest
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Get the validation rules that apply to the request.
|
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
|
||||||
public function rules()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'name' => 'required',
|
|
||||||
'payment' => 'required',
|
|
||||||
'config' => 'required'
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function messages()
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'name.required' => '显示名称不能为空',
|
|
||||||
'payment.required' => '网关参数不能为空',
|
|
||||||
'config.required' => '配置参数不能为空'
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
2
public/theme/v2board/assets/umi.js
vendored
2
public/theme/v2board/assets/umi.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user