add marketing list

This commit is contained in:
Edward Yang 2022-09-26 12:06:33 +08:00
parent fc21a56188
commit f3a664f8ca
4 changed files with 65 additions and 0 deletions

View File

@ -0,0 +1,27 @@
<?php
/**
* MarketingController.php
*
* @copyright 2022 beikeshop.com - All Rights Reserved
* @link https://beikeshop.com
* @author Edward Yang <yangjin@guangda.work>
* @created 2022-09-26 11:49:34
* @modified 2022-09-26 11:49:34
*/
namespace Beike\Admin\Http\Controllers;
use Illuminate\Http\Request;
use Beike\Admin\Services\MarketingService;
class MarketingController
{
public function index(Request $request)
{
$plugins = MarketingService::getList();
$data = [
'plugins' => $plugins,
];
return view('admin::pages.marketing.index', $data);
}
}

View File

@ -140,6 +140,9 @@ Route::prefix($adminName)
Route::middleware('can:plugins_uninstall')->post('plugins/{code}/uninstall', [Controllers\PluginController::class, 'uninstall'])->name('plugins.uninstall');
// 插件市场
Route::middleware('can:marketing_index')->get('marketing', [Controllers\MarketingController::class, 'index'])->name('marketing.index');
// 单页
Route::middleware('can:pages_index')->get('pages', [Controllers\PagesController::class, 'index'])->name('pages.index');
Route::middleware('can:pages_index')->get('pages/autocomplete', [Controllers\PagesController::class, 'autocomplete'])->name('pages.autocomplete');

View File

@ -0,0 +1,23 @@
<?php
/**
* MarketingService.php
*
* @copyright 2022 beikeshop.com - All Rights Reserved
* @link https://beikeshop.com
* @author Edward Yang <yangjin@guangda.work>
* @created 2022-09-26 11:50:34
* @modified 2022-09-26 11:50:34
*/
namespace Beike\Admin\Services;
use Illuminate\Support\Facades\Http;
class MarketingService
{
public static function getList()
{
$url = config('beike.api_url') . '/api/plugins';
return Http::get($url)->json();
}
}

View File

@ -0,0 +1,12 @@
@extends('admin::layouts.master')
@section('title', __('admin/marketing.marketing_list'))
@section('content')
@dump($plugins)
@endsection
@push('footer')
<script>
</script>
@endpush