firstpush

This commit is contained in:
2020-09-09 13:38:03 +08:00
parent 38a7861abb
commit 9c6d4da51e
719 changed files with 167902 additions and 25 deletions

29
.gitignore vendored
View File

@@ -1,25 +1,6 @@
# ---> Laravel /tests
/vendor/ /vendor
node_modules/ /storage
npm-debug.log .idea/
yarn-error.log /.idea/
# Laravel 4 specific
bootstrap/compiled.php
app/storage/
# Laravel 5 & Lumen specific
public/storage
public/hot
# Laravel 5 & Lumen specific with changed public path
public_html/storage
public_html/hot
storage/*.key
.env .env
Homestead.yaml
Homestead.json
/.vagrant
.phpunit.result.cache

View File

@@ -0,0 +1,81 @@
<?php
namespace App\Admin\Controllers\Advert;
use App\Models\Advert;
use App\Models\Category;
use Encore\Admin\Controllers\AdminController;
use Encore\Admin\Form;
use Encore\Admin\Grid;
class IndexController extends AdminController
{
protected $title = '图片位管理';
protected function grid()
{
$grid = new Grid(new Advert);
$grid->actions(function ($actions) {
$actions->disableView();
});
$grid->filter(function ($filter) {
$filter->column(1 / 2, function ($filter) {
$filter->like('title', '图片名称');
$filter->like('category.id', '分类名称')->select(Category::selectOptions(function ($model) {
return $model->where('status', 1)->where('type', Category::TYPE_ADVERT);
}, '所有分类'));
});
$filter->disableIdFilter();
});
$grid->column('id');
$grid->column('cover', '图片')->image('', 60, 60);
$grid->column('category.title', '分类名称');
$grid->column('title', '图片名称');
$grid->column('url', '地址');
$grid->column('sort', '排序');
return $grid;
}
/**
* Make a form builder.
* @return Form
*/
protected function form()
{
$form = new Form(new Advert);
$form->text('title', '图片名称')->required();
$form->select('category_id', '所属分类')
->options(Category::selectOptions(function ($model) {
return $model->where('status', 1)->where('type', Category::TYPE_ADVERT);
}, '选择分类'))
->rules('required|min:1', [
'required' => '必须选择所属分类',
'min' => '必须选择所属分类',
]);
$form->image('cover', '封面图片')
->rules(function ($form) {
if ($form->model()->cover != []) {
return 'nullable|image';
} else {
return 'required';
}
})
->move('images/' . date('Y/m/d'))
->removable()
->uniqueName();
$form->text('url', '链接地址');
$form->number('sort', '排序')
->default(1)
->required()
->help('数字越大越靠前');
return $form;
}
}

View File

@@ -0,0 +1,65 @@
<?php
namespace App\Admin\Controllers\Article;
use App\Models\Article;
use App\Models\Category;
use Encore\Admin\Controllers\AdminController;
use Encore\Admin\Form;
use Encore\Admin\Grid;
class ArticleController extends AdminController
{
protected $title = '内容管理';
public function grid()
{
$grid = new Grid(new Article);
$grid->model()->orderBy('id', 'desc');
$grid->filter(function ($filter) {
$filter->column(1 / 2, function ($filter) {
$filter->like('title', '文章标题');
$filter->like('category.id', '所属分类')->select(Category::selectOptions(function ($model) {
return $model->where('status', 1)->whereIn('type', [Category::TYPE_ARTICLE, Category::TYPE_SHOW]);
}, '所有分类'));
});
$filter->disableIdFilter();
});
$grid->column('id', '#ID#');
$grid->column('cover', '封面图片')->image('', 100);
$grid->column('category.title', '所属分类');
$grid->column('title', '文章标题');
$grid->column('sort', '序号');
$grid->column('created_at', '创建时间');
return $grid;
}
public function form()
{
$form = new Form(new Article);
$form->text('title', '文章标题')->rules('min:2');
$form->select('category_id', '所属分类')
->options(Category::selectOptions(function ($model) {
return $model->whereIn('type', [Category::TYPE_ARTICLE, Category::TYPE_SHOW]);
}, '选择分类'))
->rules('required|min:1', [
'required' => '必须选择所属分类',
'min' => '必须选择所属分类',
]);
$form->text('keywords', '关键词')->rules('nullable');
$form->textarea('description', '内容简介')->rules('max:350');
$form->image('cover', '封面')
->move('images/' . date('Y/m/d'))
->removable()
->uniqueName();
$form->ueditor('content', '文章内容')->rules('required', ['required' => '详情不能为空']);
$form->number('sort', '序号')->default(0)->rules('required', ['required' => '序号必须填写'])->help('倒序优先');
return $form;
}
}

View File

@@ -0,0 +1,54 @@
<?php
namespace App\Admin\Controllers\Article;
use App\Models\ArticlePicture;
use Encore\Admin\Controllers\AdminController;
use Encore\Admin\Form;
use Encore\Admin\Grid;
class PictureController extends AdminController
{
protected $title = '随手拍';
public function grid()
{
$grid = new Grid(new ArticlePicture);
$grid->model()->orderBy('id', 'desc');
$grid->filter(function ($filter) {
$filter->column(1 / 2, function ($filter) {
$filter->like('title', '文章标题');
});
$filter->disableIdFilter();
});
$grid->column('id', '#ID#');
$grid->column('cover')->display(function () {
return $this->one_picture_path;
})->image('', 100);
$grid->column('category.title', '所属分类');
$grid->column('title', '文章标题');
$grid->column('sort', '序号');
$grid->column('created_at', '创建时间');
return $grid;
}
public function form()
{
$form = new Form(new ArticlePicture);
$form->text('title', '文章标题')->rules('min:2');
$form->hidden('category_id')->value(6);
$form->multipleImage('pictures', '封面')
->move('images/' . date('Y/m/d'))
->removable()
->uniqueName();
$form->number('sort', '序号')->default(0)->rules('required', ['required' => '序号必须填写'])->help('倒序优先');
return $form;
}
}

View File

@@ -0,0 +1,10 @@
<?php
namespace App\Admin\Controllers;
use Encore\Admin\Controllers\AuthController as BaseAuthController;
class AuthController extends BaseAuthController
{
}

View File

@@ -0,0 +1,149 @@
<?php
namespace App\Admin\Controllers\Category;
use App\Models\Article;
use App\Models\Category;
use Encore\Admin\Controllers\AdminController;
use Encore\Admin\Form;
use Encore\Admin\Layout\Column;
use Encore\Admin\Layout\Row;
use Encore\Admin\Tree;
use Encore\Admin\Widgets\Box;
use Encore\Admin\Widgets\Form as WidgetsForm;
use Illuminate\Support\MessageBag;
class IndexController extends AdminController
{
protected $title = '分类管理';
/**
* Index interface.
* @return \Closure
*/
public function grid()
{
return function (Row $row) {
$row->column(6, $this->treeView());
$row->column(6, function (Column $column) {
$form = new WidgetsForm();
$form->select('parent_id', '上级分类')
->options(Category::selectOptions(function ($model) {
return $model->where('status', 1);
}, '一级分类'))
;
$form->text('title', '分类名称')->rules('required');
$form->select('type', '分类类型')
->options(Category::TYPES)
->when('show', function (WidgetsForm $form) {
$form->select('article_id', '关联文章')
->options(function ($option, $info) {
return Article::whereHas('category', function ($q) {
$q->where('type', 'show');
})->pluck('title', 'id');
})->help('当分类类型是文章详情的时候需要选择关联文章');
})
->required();
$form->textarea('description', '分类简介')
->rules('nullable');
$form->text('keywords', '关键词')->rules('nullable');
$form->image('cover', 'Logo')
->move('images/' . date('Y/m/d'))
->removable()
->uniqueName();
$form->number('order', '排序')->default(0);
$form->switch('top_show', '顶部导航显示')->states()->default(1);
$form->switch('status', '显示')->states()->default(1);
$form->action(admin_url('categories'));
$column->append((new Box('新增分类', $form))->style('success'));
});
};
}
/**
* @return Tree
*/
protected function treeView()
{
return Category::tree(function (Tree $tree) {
$tree->disableCreate();
$tree->branch(function ($branch) {
if ($branch['status'] == 1) {
$payload = "<i class='fa fa-eye text-primary'></i> ";
} else {
$payload = "<i class='fa fa-eye text-gray'></i> ";
}
$payload .= " [ID:{$branch['id']}] - ";
$payload .= " <strong>{$branch['title']}</strong> ";
$payload .= " <small>{$branch['type']}</small> ";
$payload .= " <small style='color:#999'>{$branch['description']}</small>";
return $payload;
});
});
}
/**
* Make a form builder.
* @return Form
*/
protected function form()
{
$form = new Form(new Category);
$form->select('parent_id', '上级分类')->options(Category::selectOptions(function ($model) {
return $model->where('status', 1);
}, '一级分类'));
$form->text('title', '分类名称')->rules('required');
$form->select('type', '分类类型')
->options(Category::TYPES)
->when('show', function (Form $form) {
$form->select('article_id', '关联文章')
->options(function ($option, $info) {
return Article::whereHas('category', function ($q) {
$q->where('type', 'show');
})->pluck('title', 'id');
})->help('当分类类型是文章详情的时候需要选择关联文章');
})
->required();
$form->textarea('description', '分类简介')->rows(4)->rules('nullable');
$form->text('keywords', '关键词')->rules('nullable');
$form->image('cover', 'Logo')
->move('images/' . date('Y/m/d'))
->removable()
->uniqueName();
$form->number('order', '排序')->default(0)->help('正序优先');
$form->switch('status', '显示')->states()->default(1);
$form->switch('top_show', '顶部导航显示')->states();
$form->saving(function (Form $form) {
if (request()->has('title')) {
if (request()->type == Category::TYPE_SHOW && empty(request()->article_id)) {
$error = new MessageBag([
'title' => '错误',
'message' => '文章类型是文章详情的时候需要选择关联文章',
]);
return back()->withInput()->with(compact('error'));
}
}
});
return $form;
}
public function destroy($id)
{
return $this->form()->destroy($id);
}
}

View File

@@ -0,0 +1,67 @@
<?php
namespace App\Admin\Controllers;
use Encore\Admin\Controllers\AdminController;
use Encore\Admin\Form;
use Encore\Admin\Grid;
use Encore\Admin\Show;
class ExampleController extends AdminController
{
/**
* Title for current resource.
*
* @var string
*/
protected $title = 'Example controller';
/**
* Make a grid builder.
*
* @return Grid
*/
protected function grid()
{
$grid = new Grid(new ExampleModel);
$grid->column('id', __('ID'))->sortable();
$grid->column('created_at', __('Created at'));
$grid->column('updated_at', __('Updated at'));
return $grid;
}
/**
* Make a show builder.
*
* @param mixed $id
* @return Show
*/
protected function detail($id)
{
$show = new Show(ExampleModel::findOrFail($id));
$show->field('id', __('ID'));
$show->field('created_at', __('Created at'));
$show->field('updated_at', __('Updated at'));
return $show;
}
/**
* Make a form builder.
*
* @return Form
*/
protected function form()
{
$form = new Form(new ExampleModel);
$form->display('id', __('ID'));
$form->display('created_at', __('Created At'));
$form->display('updated_at', __('Updated At'));
return $form;
}
}

View File

@@ -0,0 +1,34 @@
<?php
namespace App\Admin\Controllers;
use App\Http\Controllers\Controller;
use Encore\Admin\Controllers\Dashboard;
use Encore\Admin\Layout\Column;
use Encore\Admin\Layout\Content;
use Encore\Admin\Layout\Row;
class HomeController extends Controller
{
public function index(Content $content)
{
return $content
->title('Dashboard')
->description('Description...')
->row(Dashboard::title())
->row(function (Row $row) {
$row->column(4, function (Column $column) {
$column->append(Dashboard::environment());
});
$row->column(4, function (Column $column) {
$column->append(Dashboard::extensions());
});
$row->column(4, function (Column $column) {
$column->append(Dashboard::dependencies());
});
});
}
}

View File

@@ -0,0 +1,37 @@
<?php
namespace App\Admin\Controllers\Link;
use App\Models\Link;
use Encore\Admin\Controllers\AdminController;
use Encore\Admin\Form;
use Encore\Admin\Grid;
class IndexController extends AdminController
{
protected $title = '友情链接';
public function grid()
{
$grid = new Grid(new Link);
$grid->column('id', '#ID#');
$grid->column('title', '标题');
$grid->column('url', '地址');
$grid->column('created_at', '创建时间');
return $grid;
}
public function form()
{
$form = new Form(new Link);
$form->text('title', '标题')->required();
$form->text('url', '地址')->required();
return $form;
}
}

View File

@@ -0,0 +1,12 @@
<?php
use Illuminate\Routing\Router;
Route::group([
'prefix' => config('admin.route.prefix'),
'namespace' => config('admin.route.namespace') . '\\Advert',
'middleware' => config('admin.route.middleware'),
], function (Router $router) {
$router->resource('adverts', 'IndexController');
});

View File

@@ -0,0 +1,12 @@
<?php
use Illuminate\Routing\Router;
Route::group([
'prefix' => config('admin.route.prefix'),
'namespace' => config('admin.route.namespace') . '\\Article',
'middleware' => config('admin.route.middleware'),
], function (Router $router) {
$router->resource('articles', 'ArticleController');
$router->resource('pictures', 'PictureController');
});

View File

@@ -0,0 +1,12 @@
<?php
use Illuminate\Routing\Router;
Route::group([
'prefix' => config('admin.route.prefix'),
'namespace' => config('admin.route.namespace') . '\\Category',
'middleware' => config('admin.route.middleware'),
], function (Router $router) {
$router->resource('categories', 'IndexController');
});

12
app/Admin/Routes/link.php Normal file
View File

@@ -0,0 +1,12 @@
<?php
use Illuminate\Routing\Router;
Route::group([
'prefix' => config('admin.route.prefix'),
'namespace' => config('admin.route.namespace') . '\\Link',
'middleware' => config('admin.route.middleware'),
], function (Router $router) {
$router->resource('links', 'IndexController');
});

29
app/Admin/bootstrap.php Normal file
View File

@@ -0,0 +1,29 @@
<?php
use Encore\Admin\Form;
use Encore\Admin\Grid;
Form::forget(['map', 'editor']);
Form::init(function (Form $form) {
$form->disableEditingCheck();
$form->disableCreatingCheck();
$form->disableViewCheck();
$form->tools(function (Form\Tools $tools) {
$tools->disableDelete();
$tools->disableView();
$tools->disableList();
});
});
Grid::init(function (Grid $grid) {
$grid->disableExport();
$grid->actions(function (Grid\Displayers\Actions $actions) {
$actions->disableView();
});
$grid->disableBatchActions();
$grid->filter(function ($filter) {
$filter->disableIdFilter();
});
// $grid->expandFilter();
});

21
app/Admin/routes.php Normal file
View File

@@ -0,0 +1,21 @@
<?php
use Illuminate\Routing\Router;
Admin::routes();
Route::group([
'prefix' => config('admin.route.prefix'),
'namespace' => config('admin.route.namespace'),
'middleware' => config('admin.route.middleware'),
'as' => config('admin.route.prefix') . '.',
], function (Router $router) {
$router->get('/', 'HomeController@index')->name('home');
});
require __DIR__ . '/Routes/article.php';
require __DIR__ . '/Routes/category.php';
require __DIR__ . '/Routes/link.php';
require __DIR__ . '/Routes/advert.php';

42
app/Console/Kernel.php Normal file
View File

@@ -0,0 +1,42 @@
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')
// ->hourly();
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}

View File

@@ -0,0 +1,57 @@
<?php
namespace App\Exceptions;
use Exception;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
//
];
/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];
/**
* Report or log an exception.
*
* @param \Exception $exception
* @return void
*
* @throws \Exception
*/
public function report(Throwable $exception)
{
parent::report($exception);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @return \Symfony\Component\HttpFoundation\Response
*
* @throws \Exception
*/
public function render($request, Throwable $exception)
{
return parent::render($request, $exception);
}
}

View File

@@ -0,0 +1,45 @@
<?php
namespace App\Http\Controllers;
use App\Models\Article;
use App\Models\ArticlePicture;
use App\Models\Category;
class ArticleController extends Controller
{
public function index(Category $category)
{
$articles = Article::where('category_id', $category->id)
->orderBy('created_at', 'desc')
->paginate(5);
return view('articles.index', compact('articles', 'category'));
}
public function show(Article $article)
{
$category = $article->category;
return view('articles.show', compact('article', 'category'));
}
public function category(Category $category)
{
$article = Article::where('category_id', $category->id)->first();
return view('articles.show', compact('article'));
}
public function picture(Category $category)
{
$articles = ArticlePicture::where('category_id', $category->id)
->orderBy('created_at', 'desc')
->paginate(12);
return view('articles.picture', compact('articles', 'category'));
}
public function picshow(ArticlePicture $article)
{
return view('articles.picshow', compact('article'));
}
}

View File

@@ -0,0 +1,40 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\ConfirmsPasswords;
class ConfirmPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Confirm Password Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password confirmations and
| uses a simple trait to include the behavior. You're free to explore
| this trait and override any functions that require customization.
|
*/
use ConfirmsPasswords;
/**
* Where to redirect users when the intended url fails.
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
}

View File

@@ -0,0 +1,22 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
class ForgotPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset emails and
| includes a trait which assists in sending these notifications from
| your application to your users. Feel free to explore this trait.
|
*/
use SendsPasswordResetEmails;
}

View File

@@ -0,0 +1,40 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
class LoginController extends Controller
{
/*
|--------------------------------------------------------------------------
| Login Controller
|--------------------------------------------------------------------------
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
*/
use AuthenticatesUsers;
/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest')->except('logout');
}
}

View File

@@ -0,0 +1,73 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use App\User;
use Illuminate\Foundation\Auth\RegistersUsers;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
class RegisterController extends Controller
{
/*
|--------------------------------------------------------------------------
| Register Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users as well as their
| validation and creation. By default this controller uses a trait to
| provide this functionality without requiring any additional code.
|
*/
use RegistersUsers;
/**
* Where to redirect users after registration.
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => ['required', 'string', 'min:8', 'confirmed'],
]);
}
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return \App\User
*/
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
]);
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\ResetsPasswords;
class ResetPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset requests
| and uses a simple trait to include this behavior. You're free to
| explore this trait and override any methods you wish to tweak.
|
*/
use ResetsPasswords;
/**
* Where to redirect users after resetting their password.
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
}

View File

@@ -0,0 +1,42 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use App\Providers\RouteServiceProvider;
use Illuminate\Foundation\Auth\VerifiesEmails;
class VerificationController extends Controller
{
/*
|--------------------------------------------------------------------------
| Email Verification Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling email verification for any
| user that recently registered with the application. Emails may also
| be re-sent if the user didn't receive the original email message.
|
*/
use VerifiesEmails;
/**
* Where to redirect users after verification.
*
* @var string
*/
protected $redirectTo = RouteServiceProvider::HOME;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
$this->middleware('signed')->only('verify');
$this->middleware('throttle:6,1')->only('verify', 'resend');
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Http\Controllers;
use App\Models\Category;
class CategoryController extends Controller
{
/**
* Notes: 分类下的文章
* @Author: 玄尘
* @Date : 2020/6/1 9:19
* @param \App\Models\Category $category
*/
public function articles(Category $category)
{
}
}

View File

@@ -0,0 +1,36 @@
<?php
namespace App\Http\Controllers;
use App\Models\Advert;
use App\Models\Article;
use App\Models\Category;
use App\Models\Link;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Support\Facades\View;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
public function __construct()
{
//顶部分类
$categorys = Category::where('parent_id', 0)
->where('status', 1)
->where('top_show', 1)
->select('id', 'title', 'type', 'order', 'article_id')
->orderBy('order', 'asc')
->get();
$links = Link::get();
View::share('all_categorys', $categorys);
View::share('links', $links);
}
}

View File

@@ -0,0 +1,37 @@
<?php
namespace App\Http\Controllers;
use App\Models\Advert;
use App\Models\Article;
use App\Models\ArticlePicture;
class IndexController extends Controller
{
/**
* Notes: 首页
* @Author: 玄尘
* @Date : 2020/6/1 9:11
*/
public function index()
{
$ssp = ArticlePicture::orderBy('sort', 'desc')->take(3)->get(); //随手拍
$all_articles = Article::orderBy('sort', 'desc')
->whereNotIn('category_id', [20, 21, 22])
->take(7)
->get(); //最新资讯
$danwei = Article::where('category_id', 15)->latest()->first(); //单位概况
$ysbj = Article::where('category_id', 12)->latest()->take(3)->get(); //养生保健
$dcyfx = Article::where('category_id', 10)->latest()->take(7)->get(); //调研与分析
$yyjcyj = Article::where('category_id', 9)->latest()->take(7)->get(); //应用基础研究
$jsyt = Article::where('category_id', 11)->latest()->take(7)->get(); //技术研讨
$kyyyy = Article::where('category_id', 12)->latest()->take(7)->get(); //科研与应用
$qkys = Article::where('category_id', 9)->latest()->take(7)->get(); //全科医学
$center_advert = Advert::where('category_id', 18)->first();
$qikan_advert = Advert::where('category_id', 19)->take(4)->orderBy('sort', 'desc')->get();
return view('index.index', compact('ssp', 'all_articles', 'danwei', 'ysbj', 'dcyfx', 'yyjcyj', 'jsyt', 'kyyyy', 'qkys', 'center_advert', 'qikan_advert'));
}
}

View File

@@ -0,0 +1,161 @@
<?php
namespace App\Http\Controllers;
use App\Models\Article;
use App\Models\Category;
use App\Models\DedeArchive;
use App\Models\DedeArctype;
use App\Traits\Tree;
class TestController extends Controller
{
use Tree;
public function index()
{
}
public function setCateArticle()
{
$article = [];
$lists = Category::where('content', '<>', '')->where('type', 'article')->get();
if ($lists->isEmpty()) {
dd('没有数据');
}
foreach ($lists as $key => $cate) {
if ($cate->content != '&nbsp;') {
$data = [
'oldid' => 0,
'title' => $cate->title,
'category_id' => $cate->id,
'writer' => 'admin',
'source' => '未知',
'keywords' => '',
'status' => 1,
'description' => $cate->description,
'content' => $cate->content,
];
$info = Article::create($data);
$cate->article_id = $info->id;
$cate->type = Category::TYPE_SHOW;
$cate->save();
$article[] = $info->id;
}
}
dump(count($article));
}
public function checkArticle()
{
$articleids = Article::where('oldid', '>', 0)->pluck('oldid');
$oldids = DedeArchive::pluck('id');
$diffids = array_diff($oldids->toArray(), $articleids->toArray());
dump(count($articleids));
dump(count($oldids));
dump($diffids);
die();
$map = [
'id' => ['in', $diffids],
];
$list = DedeArchive::whereIn('id', $diffids)->get();
foreach ($list as $key => $article) {
$data = [
'oldid' => $article->id,
'title' => $article->title,
'category_id' => $category->id ?? '0',
'writer' => $article->writer,
'cover' => $article->litpic,
'source' => $article->source,
'keywords' => $article->keywords,
'description' => $article->description,
'status' => 1,
'content' => $article->info->body ?? '',
'created_at' => date('Y-m-d H:i:s', $article->pubdate),
];
Article::create($data);
}
}
//导入文章
public function set_article()
{
$articles = Article::get();
if ($articles->count() > 4) {
dd('已经导入过数据');
}
$categorys = Category::get();
$error = $success = [];
DedeArchive::whereNotNull('litpic')->chunk(200, function ($articles) use ($categorys) {
foreach ($articles as $article) {
$category = $categorys->where('oldid', $article->typeid)->first();
$id = $category->id ?? 0;
if (in_array($id, [9, 10, 11, 12])) {
$data = [
'oldid' => $article->id,
'title' => $article->title,
'category_id' => $category->id ?? '0',
'writer' => $article->writer,
'source' => $article->source,
'cover' => $article->litpic,
'keywords' => $article->keywords,
'description' => $article->description,
'status' => 1,
'content' => $article->info->body ?? '',
'created_at' => date('Y-m-d H:i:s', $article->pubdate),
];
$res = Article::create($data);
if (!$res) {
$error[] = $article->id;
} else {
$success[] = $article->id;
}
}
}
});
dump($error);
dump($success);
}
//导入分类
public function set_category()
{
$categorys = Category::get();
if ($categorys->count()) {
dd('已经导入过数据');
}
$lists = DedeArctype::where('ishidden', 0)->select('id', 'reid as parent_id', 'typename as title', 'content')->get();
$list = Tree::list2tree($lists->toArray(), 'id', 'parent_id', 'children', 0);
foreach ($list as $key => $value) {
$info = Category::create($this->getData($value));
if (isset($value['children']) && count($value['children']) > 0) {
foreach ($value['children'] as $key => $children) {
$info->children()->create($this->getData($children));
}
}
}
}
//格式化分类数据
public function getData($category)
{
$data = [
'oldid' => $category['id'],
'parent_id' => $category['parent_id'],
'title' => $category['title'],
'content' => $category['content'],
'status' => 1,
];
return $data;
}
}

82
app/Http/Kernel.php Normal file
View File

@@ -0,0 +1,82 @@
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array
*/
protected $middleware = [
\App\Http\Middleware\TrustProxies::class,
\App\Http\Middleware\CheckForMaintenanceMode::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
];
/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
'api' => [
'throttle:60,1',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];
/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array
*/
protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
];
/**
* The priority-sorted list of middleware.
*
* This forces non-global middleware to always be in the given order.
*
* @var array
*/
protected $middlewarePriority = [
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\Authenticate::class,
\Illuminate\Routing\Middleware\ThrottleRequests::class,
\Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\Illuminate\Auth\Middleware\Authorize::class,
];
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
* @return string|null
*/
protected function redirectTo($request)
{
if (! $request->expectsJson()) {
return route('login');
}
}
}

View File

@@ -0,0 +1,17 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware;
class CheckForMaintenanceMode extends Middleware
{
/**
* The URIs that should be reachable while maintenance mode is enabled.
*
* @var array
*/
protected $except = [
//
];
}

View File

@@ -0,0 +1,17 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
class EncryptCookies extends Middleware
{
/**
* The names of the cookies that should not be encrypted.
*
* @var array
*/
protected $except = [
//
];
}

View File

@@ -0,0 +1,27 @@
<?php
namespace App\Http\Middleware;
use App\Providers\RouteServiceProvider;
use Closure;
use Illuminate\Support\Facades\Auth;
class RedirectIfAuthenticated
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
* @return mixed
*/
public function handle($request, Closure $next, $guard = null)
{
if (Auth::guard($guard)->check()) {
return redirect(RouteServiceProvider::HOME);
}
return $next($request);
}
}

View File

@@ -0,0 +1,18 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
class TrimStrings extends Middleware
{
/**
* The names of the attributes that should not be trimmed.
*
* @var array
*/
protected $except = [
'password',
'password_confirmation',
];
}

View File

@@ -0,0 +1,23 @@
<?php
namespace App\Http\Middleware;
use Fideloper\Proxy\TrustProxies as Middleware;
use Illuminate\Http\Request;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array|string
*/
protected $proxies;
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_ALL;
}

View File

@@ -0,0 +1,24 @@
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware
{
/**
* Indicates whether the XSRF-TOKEN cookie should be set on the response.
*
* @var bool
*/
protected $addHttpCookie = true;
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
//
];
}

15
app/Models/Advert.php Normal file
View File

@@ -0,0 +1,15 @@
<?php
namespace App\Models;
use App\Models\Traits\BelongsToCategory;
use App\Models\Traits\HasOneCover;
use App\Models\Traits\OrderByIdDesc;
use App\Scopes\SortScope;
class Advert extends Model
{
use HasOneCover,
BelongsToCategory;
}

11
app/Models/Article.php Normal file
View File

@@ -0,0 +1,11 @@
<?php
namespace App\Models;
use App\Models\Traits\BelongsToCategory;
use App\Models\Traits\HasOneCover;
class Article extends Model
{
use HasOneCover, BelongsToCategory;
}

View File

@@ -0,0 +1,33 @@
<?php
namespace App\Models;
use App\Models\Traits\BelongsToCategory;
use Illuminate\Support\Facades\Storage;
class ArticlePicture extends Model
{
use BelongsToCategory;
public function setPicturesAttribute($pictures)
{
if (is_array($pictures)) {
$this->attributes['pictures'] = json_encode($pictures);
}
}
public function getPicturesAttribute($pictures)
{
return json_decode($pictures, true);
}
public function getOnePicturePathAttribute(): string
{
$cover = $this->pictures;
if (empty($cover)) {
return '';
} else {
return Storage::disk('public')->url($cover[0]);
}
}
}

57
app/Models/Category.php Normal file
View File

@@ -0,0 +1,57 @@
<?php
namespace App\Models;
use Encore\Admin\Traits\AdminBuilder;
use Encore\Admin\Traits\ModelTree;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Category extends Model
{
use AdminBuilder, ModelTree;
public const TYPES = [
'article' => '文章列表',
'show' => '文章详情',
'advert' => '广告',
'picture' => '图册',
];
public const TYPE_SHOW = 'show';
public const TYPE_ARTICLE = 'article';
public const TYPE_ADVERT = 'advert';
public const TYPE_PICTURE = 'picture';
/**
* 关联的数据
* @return [type] [description]
*/
public function relations()
{
switch ($this->type) {
case self::TYPE_SHOW:
return $this->hasOne(Article::class,'id','article_id');
break;
case self::TYPE_ARTICLE:
return $this->hasMany(Article::class);
break;
case self::TYPE_ADVERT:
return $this->hasMany(Advert::class);
break;
default:
return null;
}
}
public function parent(): BelongsTo
{
return $this->belongsTo(__CLASS__)->withDefault(['name' => '顶级分类']);
}
public function children(): HasMany
{
return $this->hasMany(__CLASS__, 'parent_id');
}
}

View File

@@ -0,0 +1,7 @@
<?php
namespace App\Models;
class DedeAddonarticle extends Model
{
}

View File

@@ -0,0 +1,11 @@
<?php
namespace App\Models;
class DedeArchive extends Model
{
public function info()
{
return $this->hasOne(DedeAddonarticle::class, 'aid');
}
}

View File

@@ -0,0 +1,11 @@
<?php
namespace App\Models;
use Encore\Admin\Traits\AdminBuilder;
use Encore\Admin\Traits\ModelTree;
class DedeArctype extends Model
{
use AdminBuilder, ModelTree;
}

8
app/Models/Link.php Normal file
View File

@@ -0,0 +1,8 @@
<?php
namespace App\Models;
class Link extends Model
{
//
}

22
app/Models/Model.php Normal file
View File

@@ -0,0 +1,22 @@
<?php
namespace App\Models;
use DateTimeInterface;
use Illuminate\Database\Eloquent\Model as Eloquent;
class Model extends Eloquent
{
protected $guarded = [];
/**
* 为数组 / JSON 序列化准备日期。
*
* @param \DateTimeInterface $date
* @return string
*/
protected function serializeDate(DateTimeInterface $date)
{
return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Models\Traits;
use App\Models\Category;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
trait BelongsToCategory
{
/**
* 关联分类表
* @author 玄尘 2020-03-05
* @return BelongsTo
*/
public function category(): BelongsTo
{
return $this->belongsTo(Category::class)->withDefault();
}
}

View File

@@ -0,0 +1,24 @@
<?php
namespace App\Models\Traits;
use Illuminate\Support\Facades\Storage;
trait HasOneCover
{
/**
* 拼接图片全地址
* @author 玄尘 2020-03-05
* @return string
*/
public function getCoverPathAttribute(): ?string
{
if ($this->cover) {
return Storage::url($this->cover);
} else {
return '';
}
}
}

View File

@@ -0,0 +1,36 @@
<?php
namespace App\Providers;
use Encore\Admin\Config\Config;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;
//add fixed sql
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
{
Schema::defaultStringLength(191); //add fixed sql
}
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
$table = config('admin.extensions.config.table', 'admin_config');
if (Schema::hasTable($table)) {
Config::load();
}
Paginator::defaultView('pagination::customize');
}
}

View File

@@ -0,0 +1,30 @@
<?php
namespace App\Providers;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Gate;
class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
*
* @var array
*/
protected $policies = [
// 'App\Model' => 'App\Policies\ModelPolicy',
];
/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
{
$this->registerPolicies();
//
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Broadcast;
use Illuminate\Support\ServiceProvider;
class BroadcastServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Broadcast::routes();
require base_path('routes/channels.php');
}
}

View File

@@ -0,0 +1,34 @@
<?php
namespace App\Providers;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event;
class EventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
Registered::class => [
SendEmailVerificationNotification::class,
],
];
/**
* Register any events for your application.
*
* @return void
*/
public function boot()
{
parent::boot();
//
}
}

View File

@@ -0,0 +1,80 @@
<?php
namespace App\Providers;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Route;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to your controller routes.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
*/
protected $namespace = 'App\Http\Controllers';
/**
* The path to the "home" route for your application.
*
* @var string
*/
public const HOME = '/home';
/**
* Define your route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
{
//
parent::boot();
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
{
$this->mapApiRoutes();
$this->mapWebRoutes();
//
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
}
}

90
app/Traits/Tree.php Normal file
View File

@@ -0,0 +1,90 @@
<?php
// +------------------------------------------------+
// | http://www.cjango.com |
// +------------------------------------------------+
// | 修复BUG不是一朝一夕的事情等我喝醉了再说吧 |
// +------------------------------------------------+
// | Author: 小陈叔叔 <Jason.Chen> |
// +------------------------------------------------+
namespace App\Traits;
/**
* 生成多层树状下拉选框的工具
*/
trait Tree
{
/**
* 用于树型数组完成递归格式的全局变量
*/
private static $formatTree;
/**
* 生成多层树,供下拉选框使用
*/
public static function toFormatTree($list, $title = 'title', $pk = 'id', $pid = 'pid', $root = 0)
{
$list = self::list2tree($list, $pk, $pid, '_child', $root);
self::$formatTree = [];
self::_toFormatTree($list, 0, $title);
return self::$formatTree;
}
/**
* 把数据集转换成Tree
* @param array $list 要转换的数据集
* @param string $pk [description]
* @param string $pid [description]
* @param string $child [description]
* @param integer $root [description]
* @return array
*/
public static function list2tree($list, $pk = 'id', $pid = 'pid', $child = 'children', $root = 0)
{
$tree = [];
if (is_array($list)) {
$refer = [];
foreach ($list as $key => $data) {
$refer[$data[$pk]] = &$list[$key];
}
foreach ($list as $key => $data) {
$parentId = $data[$pid];
if ($root == $parentId) {
$tree[] = &$list[$key];
} else {
if (isset($refer[$parentId])) {
$parent = &$refer[$parentId];
$parent[$child][] = &$list[$key];
}
}
}
}
return $tree;
}
/**
* 将格式数组转换为树
* @param array $list
* @param integer $level 进行递归时传递用的参数
* @author 小陈叔叔 <Jason.Chen[cjango.com]>
*/
private static function _toFormatTree($list, $level = 0, $title = 'title')
{
foreach ($list as $key => $val) {
$tmp_str = str_repeat("&nbsp;", $level * 4);
$tmp_str .= "└&nbsp;";
$val['level'] = $level;
$val['title_show'] = $level == 0 ? $val[$title] . "&nbsp;" : $tmp_str . $val[$title];
if (!array_key_exists('_child', $val)) {
array_push(self::$formatTree, $val);
} else {
$tmp_ary = $val['_child'];
unset($val['_child']);
array_push(self::$formatTree, $val);
self::_toFormatTree($tmp_ary, $level + 1, $title); //进行下一层递归
}
}
return;
}
}

39
app/User.php Normal file
View File

@@ -0,0 +1,39 @@
<?php
namespace App;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
}

53
artisan Normal file
View File

@@ -0,0 +1,53 @@
#!/usr/bin/env php
<?php
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any our classes "manually". Feels great to relax.
|
*/
require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Artisan Application
|--------------------------------------------------------------------------
|
| When we run the console application, the current CLI command will be
| executed in this console and the response sent back to a terminal
| or another output device for the developers. Here goes nothing!
|
*/
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$status = $kernel->handle(
$input = new Symfony\Component\Console\Input\ArgvInput,
new Symfony\Component\Console\Output\ConsoleOutput
);
/*
|--------------------------------------------------------------------------
| Shutdown The Application
|--------------------------------------------------------------------------
|
| Once Artisan has finished running, we will fire off the shutdown events
| so that any final work may be done by the application before we shut
| down the process. This is the last thing to happen to the request.
|
*/
$kernel->terminate($input, $status);
exit($status);

55
bootstrap/app.php Normal file
View File

@@ -0,0 +1,55 @@
<?php
/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new Laravel application instance
| which serves as the "glue" for all the components of Laravel, and is
| the IoC container for the system binding all of the various parts.
|
*/
$app = new Illuminate\Foundation\Application(
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);
/*
|--------------------------------------------------------------------------
| Bind Important Interfaces
|--------------------------------------------------------------------------
|
| Next, we need to bind some important interfaces into the container so
| we will be able to resolve them when needed. The kernels serve the
| incoming requests to this application from both the web and CLI.
|
*/
$app->singleton(
Illuminate\Contracts\Http\Kernel::class,
App\Http\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Console\Kernel::class,
App\Console\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Debug\ExceptionHandler::class,
App\Exceptions\Handler::class
);
/*
|--------------------------------------------------------------------------
| Return The Application
|--------------------------------------------------------------------------
|
| This script returns the application instance. The instance is given to
| the calling script so we can separate the building of the instances
| from the actual running of the application and sending responses.
|
*/
return $app;

2
bootstrap/cache/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*
!.gitignore

64
composer.json Normal file
View File

@@ -0,0 +1,64 @@
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2",
"codingyu/ueditor": "^3.0",
"encore/laravel-admin": "^1.8",
"fideloper/proxy": "^4.0",
"laravel-admin-ext/config": "^1.1",
"laravel/framework": "^7.0",
"laravel/tinker": "^2.0"
},
"require-dev": {
"facade/ignition": "^2.0",
"fzaninotto/faker": "^1.9.1",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
}
}

7376
composer.lock generated Normal file

File diff suppressed because it is too large Load Diff

409
config/admin.php Normal file
View File

@@ -0,0 +1,409 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Laravel-admin name
|--------------------------------------------------------------------------
|
| This value is the name of laravel-admin, This setting is displayed on the
| login page.
|
*/
'name' => '黑龙江科学杂志',
/*
|--------------------------------------------------------------------------
| Laravel-admin logo
|--------------------------------------------------------------------------
|
| The logo of all admin pages. You can also set it as an image by using a
| `img` tag, eg '<img src="http://logo-url" alt="Admin logo">'.
|
*/
'logo' => '<b>科学</b>杂志',
/*
|--------------------------------------------------------------------------
| Laravel-admin mini logo
|--------------------------------------------------------------------------
|
| The logo of all admin pages when the sidebar menu is collapsed. You can
| also set it as an image by using a `img` tag, eg
| '<img src="http://logo-url" alt="Admin logo">'.
|
*/
'logo-mini' => '<b>kxzz</b>',
/*
|--------------------------------------------------------------------------
| Laravel-admin bootstrap setting
|--------------------------------------------------------------------------
|
| This value is the path of laravel-admin bootstrap file.
|
*/
'bootstrap' => app_path('Admin/bootstrap.php'),
/*
|--------------------------------------------------------------------------
| Laravel-admin route settings
|--------------------------------------------------------------------------
|
| The routing configuration of the admin page, including the path prefix,
| the controller namespace, and the default middleware. If you want to
| access through the root path, just set the prefix to empty string.
|
*/
'route' => [
'prefix' => env('ADMIN_ROUTE_PREFIX', 'admin'),
'namespace' => 'App\\Admin\\Controllers',
'middleware' => ['web', 'admin'],
],
/*
|--------------------------------------------------------------------------
| Laravel-admin install directory
|--------------------------------------------------------------------------
|
| The installation directory of the controller and routing configuration
| files of the administration page. The default is `app/Admin`, which must
| be set before running `artisan admin::install` to take effect.
|
*/
'directory' => app_path('Admin'),
/*
|--------------------------------------------------------------------------
| Laravel-admin html title
|--------------------------------------------------------------------------
|
| Html title for all pages.
|
*/
'title' => '管理平台',
/*
|--------------------------------------------------------------------------
| Access via `https`
|--------------------------------------------------------------------------
|
| If your page is going to be accessed via https, set it to `true`.
|
*/
'https' => env('ADMIN_HTTPS', false),
/*
|--------------------------------------------------------------------------
| Laravel-admin auth setting
|--------------------------------------------------------------------------
|
| Authentication settings for all admin pages. Include an authentication
| guard and a user provider setting of authentication driver.
|
| You can specify a controller for `login` `logout` and other auth routes.
|
*/
'auth' => [
'controller' => App\Admin\Controllers\AuthController::class,
'guard' => 'admin',
'guards' => [
'admin' => [
'driver' => 'session',
'provider' => 'admin',
],
],
'providers' => [
'admin' => [
'driver' => 'eloquent',
'model' => Encore\Admin\Auth\Database\Administrator::class,
],
],
// Add "remember me" to login form
'remember' => true,
// Redirect to the specified URI when user is not authorized.
'redirect_to' => 'auth/login',
// The URIs that should be excluded from authorization.
'excepts' => [
'auth/login',
'auth/logout',
'_handle_action_',
],
],
/*
|--------------------------------------------------------------------------
| Laravel-admin upload setting
|--------------------------------------------------------------------------
|
| File system configuration for form upload files and images, including
| disk and upload path.
|
*/
'upload' => [
// Disk in `config/filesystem.php`.
'disk' => 'admin',
// Image and file upload path under the disk above.
'directory' => [
'image' => 'images',
'file' => 'files',
],
],
/*
|--------------------------------------------------------------------------
| Laravel-admin database settings
|--------------------------------------------------------------------------
|
| Here are database settings for laravel-admin builtin model & tables.
|
*/
'database' => [
// Database connection for following tables.
'connection' => '',
// User tables and model.
'users_table' => 'admin_users',
'users_model' => Encore\Admin\Auth\Database\Administrator::class,
// Role table and model.
'roles_table' => 'admin_roles',
'roles_model' => Encore\Admin\Auth\Database\Role::class,
// Permission table and model.
'permissions_table' => 'admin_permissions',
'permissions_model' => Encore\Admin\Auth\Database\Permission::class,
// Menu table and model.
'menu_table' => 'admin_menu',
'menu_model' => Encore\Admin\Auth\Database\Menu::class,
// Pivot table for table above.
'operation_log_table' => 'admin_operation_log',
'user_permissions_table' => 'admin_user_permissions',
'role_users_table' => 'admin_role_users',
'role_permissions_table' => 'admin_role_permissions',
'role_menu_table' => 'admin_role_menu',
],
/*
|--------------------------------------------------------------------------
| User operation log setting
|--------------------------------------------------------------------------
|
| By setting this option to open or close operation log in laravel-admin.
|
*/
'operation_log' => [
'enable' => true,
/*
* Only logging allowed methods in the list
*/
'allowed_methods' => ['GET', 'HEAD', 'POST', 'PUT', 'DELETE', 'CONNECT', 'OPTIONS', 'TRACE', 'PATCH'],
/*
* Routes that will not log to database.
*
* All method to path like: admin/auth/logs
* or specific method to path like: get:admin/auth/logs.
*/
'except' => [
'admin/auth/logs*',
],
],
/*
|--------------------------------------------------------------------------
| Indicates whether to check route permission.
|--------------------------------------------------------------------------
*/
'check_route_permission' => true,
/*
|--------------------------------------------------------------------------
| Indicates whether to check menu roles.
|--------------------------------------------------------------------------
*/
'check_menu_roles' => true,
/*
|--------------------------------------------------------------------------
| User default avatar
|--------------------------------------------------------------------------
|
| Set a default avatar for newly created users.
|
*/
'default_avatar' => '/vendor/laravel-admin/AdminLTE/dist/img/user2-160x160.jpg',
/*
|--------------------------------------------------------------------------
| Admin map field provider
|--------------------------------------------------------------------------
|
| Supported: "tencent", "google", "yandex".
|
*/
'map_provider' => 'google',
/*
|--------------------------------------------------------------------------
| Application Skin
|--------------------------------------------------------------------------
|
| This value is the skin of admin pages.
| @see https://adminlte.io/docs/2.4/layout
|
| Supported:
| "skin-blue", "skin-blue-light", "skin-yellow", "skin-yellow-light",
| "skin-green", "skin-green-light", "skin-purple", "skin-purple-light",
| "skin-red", "skin-red-light", "skin-black", "skin-black-light".
|
*/
'skin' => 'skin-blue-light',
/*
|--------------------------------------------------------------------------
| Application layout
|--------------------------------------------------------------------------
|
| This value is the layout of admin pages.
| @see https://adminlte.io/docs/2.4/layout
|
| Supported: "fixed", "layout-boxed", "layout-top-nav", "sidebar-collapse",
| "sidebar-mini".
|
*/
'layout' => ['fixed', 'sidebar-mini'],
/*
|--------------------------------------------------------------------------
| Login page background image
|--------------------------------------------------------------------------
|
| This value is used to set the background image of login page.
|
*/
'login_background_image' => '',
/*
|--------------------------------------------------------------------------
| Show version at footer
|--------------------------------------------------------------------------
|
| Whether to display the version number of laravel-admin at the footer of
| each page
|
*/
'show_version' => true,
/*
|--------------------------------------------------------------------------
| Show environment at footer
|--------------------------------------------------------------------------
|
| Whether to display the environment at the footer of each page
|
*/
'show_environment' => true,
/*
|--------------------------------------------------------------------------
| Menu bind to permission
|--------------------------------------------------------------------------
|
| whether enable menu bind to a permission
*/
'menu_bind_permission' => true,
/*
|--------------------------------------------------------------------------
| Enable default breadcrumb
|--------------------------------------------------------------------------
|
| Whether enable default breadcrumb for every page content.
*/
'enable_default_breadcrumb' => true,
/*
|--------------------------------------------------------------------------
| Enable/Disable assets minify
|--------------------------------------------------------------------------
*/
'minify_assets' => [
// Assets will not be minified.
'excepts' => [
],
],
/*
|--------------------------------------------------------------------------
| Enable/Disable sidebar menu search
|--------------------------------------------------------------------------
*/
'enable_menu_search' => true,
/*
|--------------------------------------------------------------------------
| Alert message that will displayed on top of the page.
|--------------------------------------------------------------------------
*/
'top_alert' => '',
/*
|--------------------------------------------------------------------------
| The global Grid action display class.
|--------------------------------------------------------------------------
*/
'grid_action_class' => \Encore\Admin\Grid\Displayers\DropdownActions::class,
/*
|--------------------------------------------------------------------------
| Extension Directory
|--------------------------------------------------------------------------
|
| When you use command `php artisan admin:extend` to generate extensions,
| the extension files will be generated in this directory.
*/
'extension_dir' => app_path('Admin/Extensions'),
/*
|--------------------------------------------------------------------------
| Settings for extensions.
|--------------------------------------------------------------------------
|
| You can find all available extensions here
| https://github.com/laravel-admin-extensions.
|
*/
'extensions' => [
'ueditor' => [
// 如果要关掉这个扩展设置为false
'enable' => true,
// 编辑器的前端配置 参考http://fex.baidu.com/ueditor/#start-config
'config' => [
'initialFrameHeight' => 400, // 例如初始化高度
],
'field_type' => 'ueditor',
],
],
];

231
config/app.php Normal file
View File

@@ -0,0 +1,231 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
| framework needs to place the application's name in a notification or
| any other location as required by the application or its packages.
|
*/
'name' => env('APP_NAME', 'Laravel'),
/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services the application utilizes. Set this in your ".env" file.
|
*/
'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => (bool) env('APP_DEBUG', false),
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => env('APP_URL', 'http://localhost'),
'asset_url' => env('ASSET_URL', null),
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/
'timezone' => 'PRC',
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/
'locale' => 'zh-CN',
/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of
| the language folders that are provided through your application.
|
*/
'fallback_locale' => 'en',
/*
|--------------------------------------------------------------------------
| Faker Locale
|--------------------------------------------------------------------------
|
| This locale will be used by the Faker PHP library when generating fake
| data for your database seeds. For example, this will be used to get
| localized telephone numbers, street address information and more.
|
*/
'faker_locale' => 'en_US',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/
'providers' => [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Notifications\NotificationServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
/*
* Package Service Providers...
*/
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
],
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Arr' => Illuminate\Support\Arr::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'Str' => Illuminate\Support\Str::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
],
];

117
config/auth.php Normal file
View File

@@ -0,0 +1,117 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "guard" and password
| reset options for your application. You may change these defaults
| as required, but they're a perfect start for most applications.
|
*/
'defaults' => [
'guard' => 'web',
'passwords' => 'users',
],
/*
|--------------------------------------------------------------------------
| Authentication Guards
|--------------------------------------------------------------------------
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| here which uses session storage and the Eloquent user provider.
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| Supported: "session", "token"
|
*/
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'token',
'provider' => 'users',
'hash' => false,
],
],
/*
|--------------------------------------------------------------------------
| User Providers
|--------------------------------------------------------------------------
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| If you have multiple user tables or models you may configure multiple
| sources which represent each model / table. These sources may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
|
*/
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\User::class,
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
/*
|--------------------------------------------------------------------------
| Resetting Passwords
|--------------------------------------------------------------------------
|
| You may specify multiple password reset configurations if you have more
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
|
| The expire time is the number of minutes that the reset token should be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
*/
'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_resets',
'expire' => 60,
'throttle' => 60,
],
],
/*
|--------------------------------------------------------------------------
| Password Confirmation Timeout
|--------------------------------------------------------------------------
|
| Here you may define the amount of seconds before a password confirmation
| times out and the user is prompted to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
*/
'password_timeout' => 10800,
];

59
config/broadcasting.php Normal file
View File

@@ -0,0 +1,59 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Broadcaster
|--------------------------------------------------------------------------
|
| This option controls the default broadcaster that will be used by the
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
| Supported: "pusher", "redis", "log", "null"
|
*/
'default' => env('BROADCAST_DRIVER', 'null'),
/*
|--------------------------------------------------------------------------
| Broadcast Connections
|--------------------------------------------------------------------------
|
| Here you may define all of the broadcast connections that will be used
| to broadcast events to other systems or over websockets. Samples of
| each available type of connection are provided inside this array.
|
*/
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'useTLS' => true,
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
'log' => [
'driver' => 'log',
],
'null' => [
'driver' => 'null',
],
],
];

103
config/cache.php Normal file
View File

@@ -0,0 +1,103 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Cache Store
|--------------------------------------------------------------------------
|
| This option controls the default cache connection that gets used while
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
|
| Supported: "apc", "array", "database", "file",
| "memcached", "redis", "dynamodb"
|
*/
'default' => env('CACHE_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| Cache Stores
|--------------------------------------------------------------------------
|
| Here you may define all of the cache "stores" for your application as
| well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches.
|
*/
'stores' => [
'apc' => [
'driver' => 'apc',
],
'array' => [
'driver' => 'array',
],
'database' => [
'driver' => 'database',
'table' => 'cache',
'connection' => null,
],
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
],
'memcached' => [
'driver' => 'memcached',
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
'sasl' => [
env('MEMCACHED_USERNAME'),
env('MEMCACHED_PASSWORD'),
],
'options' => [
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
],
'servers' => [
[
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
'port' => env('MEMCACHED_PORT', 11211),
'weight' => 100,
],
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'cache',
],
'dynamodb' => [
'driver' => 'dynamodb',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
'endpoint' => env('DYNAMODB_ENDPOINT'),
],
],
/*
|--------------------------------------------------------------------------
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing a RAM based store such as APC or Memcached, there might
| be other applications utilizing the same cache. So, we'll specify a
| value to get prefixed to all our keys so we can avoid collisions.
|
*/
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
];

147
config/database.php Normal file
View File

@@ -0,0 +1,147 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => env('DB_CONNECTION', 'mysql'),
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'url' => env('DATABASE_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
],
'mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'schema' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer body of commands than a typical key-value system
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'client' => env('REDIS_CLIENT', 'phpredis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
],
'default' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_DB', '0'),
],
'cache' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', '6379'),
'database' => env('REDIS_CACHE_DB', '1'),
],
],
];

77
config/filesystems.php Normal file
View File

@@ -0,0 +1,77 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application. Just store away!
|
*/
'default' => env('FILESYSTEM_DRIVER', 'local'),
/*
|--------------------------------------------------------------------------
| Default Cloud Filesystem Disk
|--------------------------------------------------------------------------
|
| Many applications store files both locally and in the cloud. For this
| reason, you may specify a default "cloud" driver here. This driver
| will be bound as the Cloud disk implementation in the container.
|
*/
'cloud' => env('FILESYSTEM_CLOUD', 's3'),
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options.
|
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
*/
'disks' => [
'admin' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL') . '/storage',
'visibility' => 'public',
],
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL') . '/storage',
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
'endpoint' => env('AWS_ENDPOINT'),
],
],
];

52
config/hashing.php Normal file
View File

@@ -0,0 +1,52 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Hash Driver
|--------------------------------------------------------------------------
|
| This option controls the default hash driver that will be used to hash
| passwords for your application. By default, the bcrypt algorithm is
| used; however, you remain free to modify this option if you wish.
|
| Supported: "bcrypt", "argon", "argon2id"
|
*/
'driver' => 'bcrypt',
/*
|--------------------------------------------------------------------------
| Bcrypt Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Bcrypt algorithm. This will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'bcrypt' => [
'rounds' => env('BCRYPT_ROUNDS', 10),
],
/*
|--------------------------------------------------------------------------
| Argon Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Argon algorithm. These will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'argon' => [
'memory' => 1024,
'threads' => 2,
'time' => 2,
],
];

104
config/logging.php Normal file
View File

@@ -0,0 +1,104 @@
<?php
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
return [
/*
|--------------------------------------------------------------------------
| Default Log Channel
|--------------------------------------------------------------------------
|
| This option defines the default log channel that gets used when writing
| messages to the logs. The name specified in this option should match
| one of the channels defined in the "channels" configuration array.
|
*/
'default' => env('LOG_CHANNEL', 'stack'),
/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
| Here you may configure the log channels for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog",
| "custom", "stack"
|
*/
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single'],
'ignore_exceptions' => false,
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
'days' => 14,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Laravel Log',
'emoji' => ':boom:',
'level' => 'critical',
],
'papertrail' => [
'driver' => 'monolog',
'level' => 'debug',
'handler' => SyslogUdpHandler::class,
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
],
],
'stderr' => [
'driver' => 'monolog',
'handler' => StreamHandler::class,
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [
'stream' => 'php://stderr',
],
],
'syslog' => [
'driver' => 'syslog',
'level' => 'debug',
],
'errorlog' => [
'driver' => 'errorlog',
'level' => 'debug',
],
'null' => [
'driver' => 'monolog',
'handler' => NullHandler::class,
],
'emergency' => [
'path' => storage_path('logs/laravel.log'),
],
],
];

136
config/mail.php Normal file
View File

@@ -0,0 +1,136 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "sendmail", "mailgun", "ses",
| "postmark", "log", "array"
|
*/
'driver' => env('MAIL_DRIVER', 'smtp'),
/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Mailgun mail service which will provide reliable deliveries.
|
*/
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to deliver e-mails to
| users of the application. Like the host we have set this value to
| stay compatible with the Mailgun e-mail application by default.
|
*/
'port' => env('MAIL_PORT', 587),
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
'sendmail' => '/usr/sbin/sendmail -bs',
/*
|--------------------------------------------------------------------------
| Markdown Mail Settings
|--------------------------------------------------------------------------
|
| If you are using Markdown based email rendering, you may configure your
| theme and component paths here, allowing you to customize the design
| of the emails. Or, you may simply stick with the Laravel defaults!
|
*/
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
/*
|--------------------------------------------------------------------------
| Log Channel
|--------------------------------------------------------------------------
|
| If you are using the "log" driver, you may specify the logging channel
| if you prefer to keep mail messages separate from other log entries
| for simpler reading. Otherwise, the default channel will be used.
|
*/
'log_channel' => env('MAIL_LOG_CHANNEL'),
];

88
config/queue.php Normal file
View File

@@ -0,0 +1,88 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Queue Connection Name
|--------------------------------------------------------------------------
|
| Laravel's queue API supports an assortment of back-ends via a single
| API, giving you convenient access to each back-end using the same
| syntax for every one. Here you may define a default connection.
|
*/
'default' => env('QUEUE_CONNECTION', 'sync'),
/*
|--------------------------------------------------------------------------
| Queue Connections
|--------------------------------------------------------------------------
|
| Here you may configure the connection information for each server that
| is used by your application. A default configuration has been added
| for each back-end shipped with Laravel. You are free to add more.
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
*/
'connections' => [
'sync' => [
'driver' => 'sync',
],
'database' => [
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 90,
],
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => 'localhost',
'queue' => 'default',
'retry_after' => 90,
'block_for' => 0,
],
'sqs' => [
'driver' => 'sqs',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'your-queue-name'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => 90,
'block_for' => null,
],
],
/*
|--------------------------------------------------------------------------
| Failed Queue Jobs
|--------------------------------------------------------------------------
|
| These options configure the behavior of failed queue job logging so you
| can control which database and table are used to store the jobs that
| have failed. You may change them to any database / table you wish.
|
*/
'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database'),
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'failed_jobs',
],
];

33
config/services.php Normal file
View File

@@ -0,0 +1,33 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Mailgun, Postmark, AWS and more. This file provides the de facto
| location for this type of information, allowing packages to have
| a conventional file to locate the various service credentials.
|
*/
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
],
'postmark' => [
'token' => env('POSTMARK_TOKEN'),
],
'ses' => [
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
];

199
config/session.php Normal file
View File

@@ -0,0 +1,199 @@
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "dynamodb", "array"
|
*/
'driver' => env('SESSION_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/
'lifetime' => env('SESSION_LIFETIME', 120),
'expire_on_close' => false,
/*
|--------------------------------------------------------------------------
| Session Encryption
|--------------------------------------------------------------------------
|
| This option allows you to easily specify that all of your session data
| should be encrypted before it is stored. All encryption will be run
| automatically by Laravel and you can use the Session like normal.
|
*/
'encrypt' => false,
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When using the native session driver, we need a location where session
| files may be stored. A default has been set for you but a different
| location may be specified. This is only needed for file sessions.
|
*/
'files' => storage_path('framework/sessions'),
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" or "redis" session drivers, you may specify a
| connection that should be used to manage these sessions. This should
| correspond to a connection in your database configuration options.
|
*/
'connection' => env('SESSION_CONNECTION', null),
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table we
| should use to manage the sessions. Of course, a sensible default is
| provided for you; however, you are free to change this as needed.
|
*/
'table' => 'sessions',
/*
|--------------------------------------------------------------------------
| Session Cache Store
|--------------------------------------------------------------------------
|
| When using the "apc", "memcached", or "dynamodb" session drivers you may
| list a cache store that should be used for these sessions. This value
| must match with one of the application's configured cache "stores".
|
*/
'store' => env('SESSION_STORE', null),
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
'lottery' => [2, 100],
/*
|--------------------------------------------------------------------------
| Session Cookie Name
|--------------------------------------------------------------------------
|
| Here you may change the name of the cookie used to identify a session
| instance by ID. The name specified here will get used every time a
| new session cookie is created by the framework for every driver.
|
*/
'cookie' => env(
'SESSION_COOKIE',
Str::slug(env('APP_NAME', 'laravel'), '_') . '_session'
),
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| The session cookie path determines the path for which the cookie will
| be regarded as available. Typically, this will be the root path of
| your application but you are free to change this when necessary.
|
*/
'path' => '/',
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
'domain' => env('SESSION_DOMAIN', null),
/*
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you if it can not be done securely.
|
*/
'secure' => env('SESSION_SECURE_COOKIE', null),
/*
|--------------------------------------------------------------------------
| HTTP Access Only
|--------------------------------------------------------------------------
|
| Setting this value to true will prevent JavaScript from accessing the
| value of the cookie and the cookie will only be accessible through
| the HTTP protocol. You are free to modify this option if needed.
|
*/
'http_only' => true,
/*
|--------------------------------------------------------------------------
| Same-Site Cookies
|--------------------------------------------------------------------------
|
| This option determines how your cookies behave when cross-site requests
| take place, and can be used to mitigate CSRF attacks. By default, we
| do not enable this as other CSRF protection services are in place.
|
| Supported: "lax", "strict", "none"
|
*/
'same_site' => 'lax',
];

116
config/ueditor.php Normal file
View File

@@ -0,0 +1,116 @@
<?php
/*
* This file is part of the overtrue/laravel-ueditor.
*
* (c) overtrue <i@overtrue.me>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
return [
// 存储引擎: config/filesystem.php 中 disks public 或 qiniu
'disk' => 'public',
'route' => [
'name' => '/ueditor/server',
'options' => [
// middleware => 'auth',
],
],
// 上传 配置
'upload' => [
/* 前后端通信相关的配置,注释只允许使用多行方式 */
/* 上传图片配置项 */
'imageActionName' => 'upload-image', /* 执行上传图片的action名称 */
'imageFieldName' => 'upfile', /* 提交的图片表单名称 */
'imageMaxSize' => 2 * 1024 * 1024, /* 上传大小限制单位B */
'imageAllowFiles' => ['.png', '.jpg', '.jpeg', '.gif', '.bmp'], /* 上传图片格式显示 */
'imageCompressEnable' => true, /* 是否压缩图片,默认是true */
'imageCompressBorder' => 1600, /* 图片压缩最长边限制 */
'imageInsertAlign' => 'none', /* 插入的图片浮动方式 */
'imageUrlPrefix' => '', /* 图片访问路径前缀 */
'imagePathFormat' => '/uploads/image/{yyyy}/{mm}/{dd}/', /* 上传保存路径,可以自定义保存路径和文件名格式 */
/* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */
/* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */
/* {time} 会替换成时间戳 */
/* {yyyy} 会替换成四位年份 */
/* {yy} 会替换成两位年份 */
/* {mm} 会替换成两位月份 */
/* {dd} 会替换成两位日期 */
/* {hh} 会替换成两位小时 */
/* {ii} 会替换成两位分钟 */
/* {ss} 会替换成两位秒 */
/* 非法字符 \ => * ? " < > | */
/* 具请体看线上文档 => fex.baidu.com/assets/#use-format_upload_filename */
/* 涂鸦图片上传配置项 */
'scrawlActionName' => 'upload-scrawl', /* 执行上传涂鸦的action名称 */
'scrawlFieldName' => 'upfile', /* 提交的图片表单名称 */
'scrawlPathFormat' => '/uploads/image/{yyyy}/{mm}/{dd}/', /* 上传保存路径,可以自定义保存路径和文件名格式 */
'scrawlMaxSize' => 2048000, /* 上传大小限制单位B */
'scrawlUrlPrefix' => '', /* 图片访问路径前缀 */
'scrawlInsertAlign' => 'none',
/* 截图工具上传 */
'snapscreenActionName' => 'upload-image', /* 执行上传截图的action名称 */
'snapscreenPathFormat' => '/uploads/image/{yyyy}/{mm}/{dd}/', /* 上传保存路径,可以自定义保存路径和文件名格式 */
'snapscreenUrlPrefix' => '', /* 图片访问路径前缀 */
'snapscreenInsertAlign' => 'none', /* 插入的图片浮动方式 */
/* 抓取远程图片配置 */
'catcherLocalDomain' => ['127.0.0.1', 'localhost', 'img.baidu.com'],
'catcherActionName' => 'catch-image', /* 执行抓取远程图片的action名称 */
'catcherFieldName' => 'source', /* 提交的图片列表表单名称 */
'catcherPathFormat' => '/uploads/image/{yyyy}/{mm}/{dd}/', /* 上传保存路径,可以自定义保存路径和文件名格式 */
'catcherUrlPrefix' => '', /* 图片访问路径前缀 */
'catcherMaxSize' => 2048000, /* 上传大小限制单位B */
'catcherAllowFiles' => ['.png', '.jpg', '.jpeg', '.gif', '.bmp'], /* 抓取图片格式显示 */
/* 上传视频配置 */
'videoActionName' => 'upload-video', /* 执行上传视频的action名称 */
'videoFieldName' => 'upfile', /* 提交的视频表单名称 */
'videoPathFormat' => '/uploads/video/{yyyy}/{mm}/{dd}/', /* 上传保存路径,可以自定义保存路径和文件名格式 */
'videoUrlPrefix' => '', /* 视频访问路径前缀 */
'videoMaxSize' => 102400000, /* 上传大小限制单位B默认100MB */
'videoAllowFiles' => [
'.flv', '.swf', '.mkv', '.avi', '.rm', '.rmvb', '.mpeg', '.mpg',
'.ogg', '.ogv', '.mov', '.wmv', '.mp4', '.webm', '.mp3', '.wav', '.mid', ], /* 上传视频格式显示 */
/* 上传文件配置 */
'fileActionName' => 'upload-file', /* controller里,执行上传视频的action名称 */
'fileFieldName' => 'upfile', /* 提交的文件表单名称 */
'filePathFormat' => '/uploads/file/{yyyy}/{mm}/{dd}/', /* 上传保存路径,可以自定义保存路径和文件名格式 */
'fileUrlPrefix' => '', /* 文件访问路径前缀 */
'fileMaxSize' => 51200000, /* 上传大小限制单位B默认50MB */
'fileAllowFiles' => [
'.png', '.jpg', '.jpeg', '.gif', '.bmp',
'.flv', '.swf', '.mkv', '.avi', '.rm', '.rmvb', '.mpeg', '.mpg',
'.ogg', '.ogv', '.mov', '.wmv', '.mp4', '.webm', '.mp3', '.wav', '.mid',
'.rar', '.zip', '.tar', '.gz', '.7z', '.bz2', '.cab', '.iso',
'.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx', '.pdf', '.txt', '.md', '.xml',
], /* 上传文件格式显示 */
/* 列出指定目录下的图片 */
'imageManagerActionName' => 'list-image', /* 执行图片管理的action名称 */
'imageManagerListPath' => '/uploads/image/', /* 指定要列出图片的目录 */
'imageManagerListSize' => 20, /* 每次列出文件数量 */
'imageManagerUrlPrefix' => '', /* 图片访问路径前缀 */
'imageManagerInsertAlign' => 'none', /* 插入的图片浮动方式 */
'imageManagerAllowFiles' => ['.png', '.jpg', '.jpeg', '.gif', '.bmp'], /* 列出的文件类型 */
/* 列出指定目录下的文件 */
'fileManagerActionName' => 'list-file', /* 执行文件管理的action名称 */
'fileManagerListPath' => '/uploads/file/', /* 指定要列出文件的目录 */
'fileManagerUrlPrefix' => '', /* 文件访问路径前缀 */
'fileManagerListSize' => 20, /* 每次列出文件数量 */
'fileManagerAllowFiles' => [
'.png', '.jpg', '.jpeg', '.gif', '.bmp',
'.flv', '.swf', '.mkv', '.avi', '.rm', '.rmvb', '.mpeg', '.mpg',
'.ogg', '.ogv', '.mov', '.wmv', '.mp4', '.webm', '.mp3', '.wav', '.mid',
'.rar', '.zip', '.tar', '.gz', '.7z', '.bz2', '.cab', '.iso',
'.doc', '.docx', '.xls', '.xlsx', '.ppt', '.pptx', '.pdf', '.txt', '.md', '.xml',
], /* 列出的文件类型 */
],
];

36
config/view.php Normal file
View File

@@ -0,0 +1,36 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| View Storage Paths
|--------------------------------------------------------------------------
|
| Most templating systems load templates from disk. Here you may specify
| an array of paths that should be checked for your views. Of course
| the usual Laravel view path has already been registered for you.
|
*/
'paths' => [
resource_path('views'),
],
/*
|--------------------------------------------------------------------------
| Compiled View Path
|--------------------------------------------------------------------------
|
| This option determines where all the compiled Blade templates will be
| stored for your application. Typically, this is within the storage
| directory. However, as usual, you are free to change this value.
|
*/
'compiled' => env(
'VIEW_COMPILED_PATH',
realpath(storage_path('framework/views'))
),
];

2
database/.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
*.sqlite
*.sqlite-journal

View File

@@ -0,0 +1,28 @@
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use App\User;
use Faker\Generator as Faker;
use Illuminate\Support\Str;
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/
$factory->define(User::class, function (Faker $faker) {
return [
'name' => $faker->name,
'email' => $faker->unique()->safeEmail,
'email_verified_at' => now(),
'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
'remember_token' => Str::random(10),
];
});

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('name');
$table->string('email')->unique();
$table->timestamp('email_verified_at')->nullable();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreatePasswordResetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
}
}

View File

@@ -0,0 +1,119 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateAdminTables extends Migration
{
/**
* {@inheritdoc}
*/
public function getConnection()
{
return config('admin.database.connection') ?: config('database.default');
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create(config('admin.database.users_table'), function (Blueprint $table) {
$table->increments('id');
$table->string('username', 190)->unique();
$table->string('password', 60);
$table->string('name');
$table->string('avatar')->nullable();
$table->string('remember_token', 100)->nullable();
$table->timestamps();
});
Schema::create(config('admin.database.roles_table'), function (Blueprint $table) {
$table->increments('id');
$table->string('name', 50)->unique();
$table->string('slug', 50)->unique();
$table->timestamps();
});
Schema::create(config('admin.database.permissions_table'), function (Blueprint $table) {
$table->increments('id');
$table->string('name', 50)->unique();
$table->string('slug', 50)->unique();
$table->string('http_method')->nullable();
$table->text('http_path')->nullable();
$table->timestamps();
});
Schema::create(config('admin.database.menu_table'), function (Blueprint $table) {
$table->increments('id');
$table->integer('parent_id')->default(0);
$table->integer('order')->default(0);
$table->string('title', 50);
$table->string('icon', 50);
$table->string('uri')->nullable();
$table->string('permission')->nullable();
$table->timestamps();
});
Schema::create(config('admin.database.role_users_table'), function (Blueprint $table) {
$table->integer('role_id');
$table->integer('user_id');
$table->index(['role_id', 'user_id']);
$table->timestamps();
});
Schema::create(config('admin.database.role_permissions_table'), function (Blueprint $table) {
$table->integer('role_id');
$table->integer('permission_id');
$table->index(['role_id', 'permission_id']);
$table->timestamps();
});
Schema::create(config('admin.database.user_permissions_table'), function (Blueprint $table) {
$table->integer('user_id');
$table->integer('permission_id');
$table->index(['user_id', 'permission_id']);
$table->timestamps();
});
Schema::create(config('admin.database.role_menu_table'), function (Blueprint $table) {
$table->integer('role_id');
$table->integer('menu_id');
$table->index(['role_id', 'menu_id']);
$table->timestamps();
});
Schema::create(config('admin.database.operation_log_table'), function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
$table->string('path');
$table->string('method', 10);
$table->string('ip');
$table->text('input');
$table->index('user_id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists(config('admin.database.users_table'));
Schema::dropIfExists(config('admin.database.roles_table'));
Schema::dropIfExists(config('admin.database.permissions_table'));
Schema::dropIfExists(config('admin.database.menu_table'));
Schema::dropIfExists(config('admin.database.user_permissions_table'));
Schema::dropIfExists(config('admin.database.role_users_table'));
Schema::dropIfExists(config('admin.database.role_permissions_table'));
Schema::dropIfExists(config('admin.database.role_menu_table'));
Schema::dropIfExists(config('admin.database.operation_log_table'));
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateFailedJobsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('failed_jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('failed_jobs');
}
}

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateArticlesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('articles', function (Blueprint $table) {
$table->bigIncrements('id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('articles');
}
}

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateCategoriesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('categories', function (Blueprint $table) {
$table->bigIncrements('id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('categories');
}
}

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateLinksTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('links', function (Blueprint $table) {
$table->bigIncrements('id');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('links');
}
}

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateArticlePicturesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('article_pictures', function (Blueprint $table) {
$table->id();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('article_pictures');
}
}

View File

@@ -0,0 +1,16 @@
<?php
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*
* @return void
*/
public function run()
{
// $this->call(UsersTableSeeder::class);
}
}

21
public/.htaccess Normal file
View File

@@ -0,0 +1,21 @@
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>

BIN
public/assets/index/css/.DS_Store vendored Normal file

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,312 @@
@charset "UTF-8";
*,html,body{ padding: 0; margin: 0; font-size: 15px; font-family: "微软雅黑"; color: #333;}
a,a:hover{ text-decoration: none; transition: all .4s;}
a{color: #333;}
a:hover{color: #273981;}
p,h1,h2,h3,h4{ margin: 0;}
ul{list-style: none; padding: 0; margin: 0;}
img{vertical-align: top;}
/* 文字裁剪 */
.nowrap { max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.nowrap-multi { display: -webkit-box; overflow: hidden; text-overflow: ellipsis; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
/* 禁止响应式 */
.container{width: 1190px; margin: 0 auto;}
/* tool */
.tool{ background-color: #fafafa;}
.tool-content{display: flex; justify-content: space-between;}
.tool-herf a,
.tool-herf span{color: #b8b8b8; line-height: 40px;}
.tool-herf span{padding: 0 10px;}
.tool-herf a:hover{color: #273981;}
.tool-search{ margin: 8px 0;}
.tool-search input{height: 24px; box-sizing: border-box; border-radius: 4px; border: solid 1px #ddd; width: 200px; padding: 0 8px;}
.tool-search button{background-color: #273981; border: 0; height: 24px; width: 24px; border-radius: 4px; font-size: 12px; vertical-align: top;}
.tool-search button i{color: white;}
/* header */
.header-content{ padding: 20px 0; display: flex; align-items:center;}
.header-logo{width: 380px; height: 55px;}
.header-text{padding-left: 100px;}
.header-text p{text-align: right; font-size: 15px; color: #273981; font-weight: bold;}
.header-text p.header-text-sign{padding-top: 5px; color: #4864ae;}
/* nav */
.nav{ background-color: #273981;}
.nav-content{position: relative;}
.nav-ul{list-style: none; padding: 0; margin: 0; display: flex; justify-content: space-between;}
.nav-ul-li{flex: 1;}
.nav-ul-li>a{color: white; display: block; font-size: 18px; font-weight: bold; text-align: center; line-height: 50px;}
.nav-ul-li:hover>a{background-color: #4864ae;}
.nav-ul-li.show>a{ background: #4864ae; color: white;}
/* 导航弹出层 */
.nav-layer{position: absolute; left: 0; top: 50px; padding: 0 10px 10px 10px; box-sizing: border-box; width: 100%; background-color: #f1f3f8; z-index: 9; overflow: hidden; display: flex;}
.nav-layer.hide{display: none;}
.nav-layer-item{padding: 10px; box-sizing: border-box;}
.nav-layer-title{position: relative; height: 50px; line-height: 50px;}
.nav-layer-title::before{position: absolute; height: 10px; background: #dbe0f3; content: ""; top: 20px; left: 0; right: 0; z-index: -1;}
.nav-layer-title span{background: #f1f3f8; padding-right: 10px; font-size: 18px; font-weight: bold;}
/* 导航层-组织机构 */
.nav-org-left{width: 800px;}
.nav-org-mian{padding-left: 220px; min-height: 124px; position: relative;}
.nav-org-cover{position: absolute; left: 0; top: 0; width: 200px; height: 124px; background-color: white;}
.nav-org-cover span{position: absolute; left: 0; top: 0; width: 100%; height: 100%; background-size: cover; background-position: center;}
.nav-org-mian p{line-height: 30px;}
.nav-org-more{text-align: right;}
.nav-org-more a{background-color: #4864AE; color: white; line-height: 30px; display: inline-block; padding: 0 15px;}
.nav-org-more i{color: white;}
.nav-org-people{margin: 10px -10px 0 -10px; display: flex; flex-wrap: wrap; justify-content: space-around;}
.nav-org-people li{width: 20%; padding: 10px; box-sizing: border-box;}
.nav-org-people li img{width: 100%; background-color: white;}
.nav-org-people li p{line-height: 35px; text-align: center; font-weight: bold; font-size: 16px;}
.nav-org-right{width: 390px;}
.nav-org-right hr{background-color: #dcdee2; margin-bottom: 10px;}
.nav-org-flex{display: flex; flex-wrap: wrap; margin: -10px -10px 0 -10px;}
.nav-org-flex li{width: 50%; padding: 0 10px; box-sizing: border-box; margin-top: 10px;}
.nav-org-flex li>a{background-color: #4864AE; color: white; display: block; line-height: 40px; text-align: center;}
.nav-org-more a:hover,
.nav-org-flex li>a:hover{background-color: #273981;}
.nav-org-flex li p{text-align: center; line-height: 20px; margin-top: 10px;}
/* 导航层-科学研究 */
.nav-science-left{width: 740px;}
.nav-science-right{width: 430px;}
.nav-science-block{position: relative; min-height: 150px;}
.nav-science-cover{width: 200px; height: 150px; background-color: white; position: absolute; top: 0; left: 0; background-size: cover; background-position: center;}
.nav-science-cover ~ .nav-science-ul{padding-left: 220px;}
.nav-science-ul li{line-height: 30px;}
.nav-science-ul li i{color: gray;}
.nav-science-covers{position: relative; min-height: 150px;}
.nav-science-covers-item{background-position: center; background-size: cover; width: 200px; background-color: white; display: block;}
.nav-science-covers-item:nth-child(2){margin-top: 10px;}
.nav-science-cover-5{height: 70px;}
.nav-science-cover-10{height: 150px; position: absolute; right: 0; top: 0;}
/* 导航层-成果转化 */
.nav-results-item{width: 50%;}
.nav-results-cover{width: 100%; padding-top: 15%; background-size: cover; background-color: white; background-position: center; display: block; margin-top: 10px;}
.nav-results-ul{padding-top: 10px;}
.nav-results-ul li{position: relative;}
.nav-results-ul i{position: absolute; left: 0; top: 0; line-height: 30px;}
.nav-results-ul a{display: block; padding: 0 100px 0 15px}
.nav-results-ul a span{position: absolute; right: 0; top: 0;}
.nav-results-ul a:hover span{color: #273981;}
/* 导航层-人才队伍 */
.nav-talent-left{width: 840px;}
.nav-talent-right{width: 330px;}
.nav-talent-ul{margin: 0 -10px;}
.nav-talent-ul li{margin: 0 10px; width: 100px; float: left; padding-bottom: 10px;}
.nav-talent-ul.nav-talent-r-ul li{width: calc(25% - 20px);}
.nav-talent-name,
.nav-talent-job{text-align: center; line-height: 20px;}
.nav-talent-job{color: gray;}
.nav-talent-cover{width: 100%; padding-top: 125%; display: block; background-size: cover; background-position: center; background-color: white; margin-bottom: 10px;}
.nav-talent-team{margin: 0 -10px;}
.nav-talent-team-item{padding-top: 30%; margin-bottom: 10px; background-color: white; display: block; background-position: center; background-size: cover;}
.nav-talent-team-item:last-child{margin-bottom: 0;}
/* 专题连接 */
.special-content{text-align: center; padding: 20px 0;}
.special-content a{color: #273981; font-weight: bold; font-size: 24px;}
.special-content a:hover{color: #4864ae;}
/* banner图 */
.swiper-slide{text-align: center; width: 1190px;}
.swiper-banner-img{width: 100%; padding-top: 33%; background-size: 100%; transition: all .2s; background-repeat: no-repeat; background-position: center; position: relative; display: block;}
.swiper-banner-img:hover{background-size: 102%;}
.swiper-banner-img h3{position: absolute; left: 0; bottom: 0; width: 100%; background-color: rgba(0,0,0,.2); box-sizing: border-box; padding: 15px 15px 50px 15px; color: white; font-size: 18px;}
.swiper-button-prev,
.swiper-button-next{position: absolute; background-color: rgba(255,255,255,.90); transition: background .5s; width: calc(50% - 595px); height: 100%; top: 0; margin: 0; background-image: none;}
.swiper-button-prev{left: 0;}
.swiper-button-next{right: 0;}
.swiper-button-prev:hover,
.swiper-button-next:hover{background-color: rgba(255,255,255,.6);}
.swiper-pagination .swiper-pagination-bullet{background-color: white; width: 12px; height: 12px; opacity: .5;}
.swiper-pagination .swiper-pagination-bullet-active{background-color: #273981; opacity: 1;}
/* mian */
.mian{overflow: hidden; padding: 20px 0;}
.mian-nav,
.mian-content{float: left;}
.mian-nav{width: 200px; padding-right: 20px;}
.mian-content{width: 970px;}
.mian-nav-cover{width: 100%;}
.mian-nav-ul li{margin-top: 10px;}
.mian-nav-ul li a{line-height: 50px; color: white; text-align: center; background-color: #4864ae; display: block; font-size: 16px; font-weight: bold;}
.mian-nav-ul li a:hover,
.mian-nav-ul li.show a{background-color: #273981;}
.mian-content-header{background-color: #f1f3f8; line-height: 40px; padding: 0 10px; margin-bottom: 20px;}
.mian-content-header i{margin: 0 10px; color: gray;}
.mian-content-header a:first-child{font-weight: bold;}
/* 首页 */
.index-mian-left,
.index-mian-right{float: left;}
.index-mian-left{margin-right: 20px; width: 870px;}
.index-mian-title{background-color: #dbe0f3; display: flex; justify-content: space-between; line-height: 40px; height: 40px; margin-top: 6px;}
.index-mian-title span{background-color: #273981; width: 150px; text-align: center; font-weight: bold; color: white; line-height: 34px; font-size: 16px; position: relative;}
.index-mian-title span::before,
.index-mian-title span::after{position: absolute; content: "";}
.index-mian-title span::before{height: 6px; top: -6px; left: 0; width: 100%; background: #273981;}
.index-mian-title span::after{border: 3px solid transparent; border-bottom: 3px solid #020d3a; border-left: 3px solid #020d3a; position: absolute; top: -6px; right: -6px;}
.index-mian-title span i{color: white; margin-right: 5px;}
.index-mian-title a{margin-right: 20px;}
.index-mian-title a,
.index-mian-title a i{color: gray;}
.index-mian-title a i{margin-left: 5px; transition: color .4s;}
.index-mian-title a:hover,
.index-mian-title a:hover i{color: #273981;}
.index-mian-news{margin:10px 0 20px 0; overflow: hidden;}
.index-mian-news-hot{background: #f1f3f8; display: block; width: 200px; float: left;}
.index-mian-news-cover{width: 100%; padding-top: 75%; display: block; background-color: #eee; background-size: 100%; background-repeat: no-repeat; background-position: center;}
.index-mian-news-cover:hover{background-size: 105%;}
.index-mian-news-href{padding: 10px; display: block;}
.index-mian-news-href:hover p{color: #273981;}
.index-mian-news-href p:first-child{font-weight: bold; margin-bottom: 5px; font-size: 15px;}
.index-mian-news-href p:last-child{text-align: right; color: gray;}
.index-mian-news-hot ~ .index-mian-news-ul{float: left; width: 670px; padding-left: 20px; box-sizing: border-box;}
.index-mian-news-ul li{position: relative; line-height: 35px;}
.index-mian-news-ul li i{color: #273981;}
.index-mian-news-ul li a{display: block; padding-right: 100px; position: relative;}
.index-mian-news-ul li a>span{position: absolute; right: 0; top: 0; color: gray;}
.index-mian-news-ul li a:hover> span{color: #273981;}
.index-mian-right{width: 300px;}
.index-mian-right-ad{background-size: 100%; background-position: center; background-repeat: no-repeat; background-color: #EEEEEE; display: block; position: relative;}
.index-mian-right-ad:hover{background-size: 105%;}
.index-mian-right-ad span{position: absolute; top: 0; left: 0; width: 100%; text-align: center; background-color: rgba(0,0,0,.1); height: 100%; display: flex; justify-content: center; align-items: center; font-size: 18px; font-weight: bold; text-shadow: 2px 2px 3px rgba(0,0,0,.2); color: white;}
.index-mian-right-ad-1{width: 100%; padding-top: 100%; margin-bottom: 20px;}
.index-mian-right-ads{display: flex; margin: 0 -10px 20px -10px;}
.index-mian-right-ad-5{width: 50%; padding-top: 30%; margin: 0 10px;}
.index-mian-right-ad-5 span{background-image: linear-gradient(to bottom,transparent, rgba(0,0,0,.4));}
.index-mian-right-ul{margin-bottom: 20px;}
.index-mian-right-ul li a{padding-right: 0;}
.index-mian-right-video{margin: 20px 0; position: relative; min-height: 170px; padding-left: 200px;}
.index-mian-right-video-item{width: 100px; height: 75px; display: block; background-color: #EEEEEE; background-position: center; background-size: 100%;}
.index-mian-right-video-item:hover{background-size: 105%;}
.index-mian-right-video-item:first-child{margin-bottom: 20px;}
.index-mian-right-video-item-lg{position: absolute; left: 0; top:0; width: 180px; height: 170px;}
/* href */
.footer-href{padding: 30px 0; background-color: #f1f3f8;}
.href-flex{display: flex; flex-wrap: wrap;}
.href-flex a{line-height: 30px; margin-right: 20px; color: gray;}
.href-flex a:hover{color: #273981;}
/* footer */
.footer{background-color: #273981; padding: 50px 0; text-align: center; font-size: 12px;}
.footer p{color: white; margin:10px 0; font-size: 14px;}
.footer img{width: 68px;}
/* 子页面通用标题栏 */
.sub-title{line-height: 40px; border-top: solid 2px #f1f3f8; display: flex; justify-content: space-between;}
.sub-title i{margin-right: 5px; color: #273981; font-size: 16px;}
.sub-title b{font-size: 16px; position: relative; padding: 0 10px;}
.sub-title b::before{position: absolute; top: -4px; left: 0; width: 100%; height: 4px; background-color: #273981; content: " ";}
/* 成果转化 - 小悦哥 */
.results-news{margin: 10px 0 20px 0; min-height: 210px; position: relative;}
.results-news-cover{width: 280px; height: 210px; position: absolute; left: 0; top: 0; background-position: center; background-size: 100%;}
.results-news-cover:hover{background-size: 105%;}
.results-news-cover span{position: absolute; left: 0; bottom: 0; padding: 10px; background-color: rgba(0,0,0,.4); color: white; font-size: 16px; font-weight: bold;}
.results-news-cover ~ .results-news-ul{padding-left: 300px;}
.results-news-ul li{line-height: 30px;}
.results-news-ul li a{display: block; position: relative; padding-right: 120px;}
.results-news-ul li a span{position: absolute; right: 0; top: 0; width: 100px; text-align: right; color: gray;}
.results-news-ul li a:hover span{color: #273981;}
.results-news-ul li a i{color: gray; font-size: 14px; color: #273981; margin-right: 5px;}
/* 科学研究-论文 */
.paper-form{background: #f1f3f8; display: block; position: relative; padding: 15px 100px 15px 165px; height:100px; box-sizing: border-box;}
.paper-form-title{position: absolute; left: 0; top: 0; height: 100px; line-height: 100px; width: 150px; background-color: #273981; text-align: center; color: white; font-size: 16px;}
.paper-form-ul{display: flex; flex-wrap: wrap;}
.paper-form-btn{width: 70px; height: 70px; background-color: #273981; border: none; border-radius: 0; text-align: center; color: white; position: absolute; top: 15px; right: 15px;}
.paper-form-inputs {width: 50%; height: 35px; padding-right: 15px; padding-left: 80px; box-sizing: border-box; position: relative;}
.paper-form-inputs label{position: absolute; left: 0; top: 0; line-height: 35px;}
.paper-form-inputs input,
.paper-form-inputs select{width: 100%; height: 25px; margin-top: 5px; padding: 0 10px; box-sizing: border-box; border:solid 1px #EEEEEE}
.paper-table{width: 100%; margin-top: 20px; border-spacing:0; border-collapse:collapse;}
.paper-table th{background-color: #f1f3f8;}
.paper-table th,
.paper-table td{text-align: center; height: 40px;}
/* 组织机构-研究所简介 */
.org-history,
.org-intro{min-height: 210px; position: relative; margin-bottom: 20px;}
.org-intro{padding-left: 360px;}
.org-history-cover,
.org-intro-cover{background-color: #EEEEEE; position: absolute; top: 0; height: 210px; width: 340px; background-position: center; background-size: cover;}
.org-intro-cover{left: 0;}
.org-intro-text,
.org-intro-more{line-height: 30px;}
.org-intro-more{text-align: right; padding-top: 10px;}
.org-intro-more a{background-color: #4864AE; padding: 0 15px; display: inline-block; color: white;}
.org-intro-more a:hover{background-color: #273981;}
.org-history{padding-right: 360px;}
.org-history-cover{right: 0;}
.org-lead-ul{margin: 0 -10px 20px -10px; overflow: hidden;}
.org-lead-ul li{margin: 10px; width: calc(33.33% - 20px); float: left; position: relative; min-height: 125px; padding-left: 120px; box-sizing: border-box;}
.org-lead-name{font-size: 16px; font-weight: bold; display: block; border-bottom: solid 1px #ddd; line-height: 40px; margin-bottom: 10px;}
.org-lead-job{color: #555; line-height: 30px;}
.org-lead-cover{width: 100px; height: 125px; display: block; background-position: center; background-size: cover; position: absolute; left: 0; top: 0;}
.org-inst{overflow: hidden; padding-left: 10px;}
.org-inst span{line-height: 40px; width: 25%; display: block; float: left; font-weight: bold;}
.org-inst-ul span i,
.org-inst span i{color: #273981; margin-right: 5px;}
.org-inst-ul{margin-bottom: 20px; padding-left: 10px;}
.org-inst-ul li{line-height: 50px; overflow: hidden;}
.org-inst-ul li span{float: left; color: gray; margin-right: 20px;}
.org-inst-ul li span:first-child,
.org-inst-ul li span:nth-child(2){font-weight: bold; color: #333; margin-right: 10px;}
.org-inst-ul li span:nth-child(2)> i{color: gray; font-size: 10px;}
/* 科学研究-科技奖励 */
.research-award-ul{margin: 0 -10px 20px -10px; overflow: hidden;}
.research-award-ul li{margin: 10px; width: calc(33.33% - 20px); float: left; position: relative; box-sizing: border-box;}
.research-award-cover{width: 100%; padding-top: 65%; display: block; background-position: center; background-size: cover;}
.research-award-title{line-height: 40px; text-align: center;}
/* 科学研究-科研进展 */
.research-evolve{margin: 0 -10px; overflow: hidden;}
.research-evolve-item{width:calc( 50% - 20px); margin: 0 10px; float: left;}
/* 科学研究-科研产出 小悦哥 */
.kycc-border{ overflow: hidden; margin: 0 -10px 20px -10px;}
.kycc-border>li{ width:calc( 50% - 20px); margin: 0 10px; float: left; }
.lw{position: relative; padding: 0 50px; min-height: 120px;}
.lw-left{ position: absolute; width:40px; height:80px; background-color:#273981; text-align:center; top: calc(50% - 40px); left: 0; display: flex; justify-content: center; align-items: center; color: white;}
.lw-center li{line-height: 30px;}
.lw-left2{ position: absolute; top: calc(50% - 30px); color: gray; right: 0; text-align: center; display: flex; justify-content: center; align-items: center; width:30px; height:60px; border:1px solid #929294; box-sizing: border-box;}
.lw-left2:hover{color: #273981; border-color: #273981;}
.lw-lg{min-height: 240px; padding-right: 0;}
.lw-left-lg{height: 160px; top: calc(50% - 80px);}
/* 党建与科学文化 */
.culture-news{margin-bottom: 20px;}
.culture-news-cover{width: 280px; height: 210px; position: absolute; right: 0; top: 0; background-position: center; background-size: 100%;}
.culture-news-cover:hover{background-size: 105%;}
.culture-news-cover span{position: absolute; left: 0; bottom: 0; padding: 10px; background-color: rgba(0,0,0,.4); color: white; font-size: 16px; font-weight: bold;}
.culture-news-cover ~ .results-news-ul{padding-right: 300px;}
/* 人才队伍 - 高级职称专家 小悦哥 */
.rcdw{ margin:0 -10px; overflow: hidden; }
.rcdw li{ float: left; margin-right:10px; margin-left:10px; margin-bottom:20px; width: calc(12.5% - 20px); background-color: #eee;}
.rcdw-cover{width: 100%; padding-top: 125%; display: block; background-position: center; background-size: cover;}
.rcdw-xxh{padding: 10px; background-color:#273981; text-align:center;}
.rcdw-xxh h3,
.rcdw-xxh p{color: white;}
/* 人才队伍 - 省领军人才梯队 */
.rctd-boeder{ border-bottom:1px solid #eee; padding-bottom: 20px; margin-bottom: 20px; min-height: 150px; padding-left: 220px; position:relative;}
.rctd-boeder:last-child{border-bottom: none; margin: 0;}
.rctd2{ position: absolute; left: 0; top: 0; width: 200px; height: 150px; background-position: center; background-size: cover;}
.rctd2 span{ position: absolute; bottom: 0; left: 0; width: 100%; height:30px; text-align: center; line-height:30px; background: rgba(0,0,0,.5); color: white; }
.rctd3-p{ position: relative; padding-left: 100px; line-height: 30px; }
.rctd3-p span{margin-right: 10px; display: inline-block; color: #555;}
.rctd3-p span:first-child{ position: absolute; left: 0; top: 0; width: 100px; font-weight: bold; color: #333;}

15
public/assets/index/css/swiper.min.css vendored Normal file

File diff suppressed because one or more lines are too long

BIN
public/assets/index/fonts/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 434 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
public/assets/index/img/.DS_Store vendored Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 MiB

Some files were not shown because too many files have changed in this diff Show More