Skip to content

Commit

Permalink
Merge branch '2.0' into 2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
medz committed Nov 2, 2018
2 parents 5ba5e49 + 9eb16ca commit 5434c71
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<div class="panel panel-default">
<div class="panel-heading">设置高德地图信息</div>
<div class="panel-body">
<form class="form-horizontal" method="POST" action="{{ route('around-amap:admin-save') }}">
<form class="form-horizontal" method="POST" action="{{ route('around-amap:admin-home') }}">
{{ csrf_field() }}

<div class="form-group{{ $errors->has('amap-key') ? ' has-error' : '' }}">
Expand Down
6 changes: 4 additions & 2 deletions packages/slimkit-plus-around-amap/routes/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
Route::group(['prefix' => 'around-amap/admin'], function (RouteRegisterContract $route) {

// Home router.
$route->get('/', Admin\HomeController::class.'@index')->name('around-amap:admin-home');
$route->post('/save', Admin\HomeController::class.'@save')->name('around-amap:admin-save');
$route
->get('/', Admin\HomeController::class.'@index')
->name('around-amap:admin-home');
$route->post('/', Admin\HomeController::class.'@save');
});
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@

class HomeController
{
public function index(Configuration $config)
public function index()
{
$conf = $config->getConfigurationBase();
$around = [];

$around['sig'] = array_get($conf, 'around-amap.amap-sig');
$around['key'] = array_get($conf, 'around-amap.amap-key');
$around['tableid'] = array_get($conf, 'around-amap.amap-tableid');
$around['jssdk'] = array_get($conf, 'around-amap.amap-jssdk');
$around['sig'] = config('around-amap.amap-sig');
$around['key'] = config('around-amap.amap-key');
$around['tableid'] = config('around-amap.amap-tableid');
$around['jssdk'] = config('around-amap.amap-jssdk');

return view('around-amap::admin', $around);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public function rules(): array
'amap-sig' => 'required|string',
'amap-tableid' => 'required|string',
'amap-key' => 'required|string',
'amap-jssdk' => 'required|string',
];
}

Expand All @@ -47,8 +46,6 @@ public function rules(): array
public function messages(): array
{
return [
'amap-jssdk.required' => '请输入 JS SDK 地址',
'amap-jssdk.string' => 'JS SDK 地址必须是字符串',
'amap-sig.required' => '请输入应用密钥',
'amap-sig.string' => '应用密钥必须是字符串',
'amap-key.required' => '请输入高德 Web 服务 Key',
Expand Down

0 comments on commit 5434c71

Please sign in to comment.