mirror of https://github.com/1099438829/apeblog
update
This commit is contained in:
parent
4bc6141b8b
commit
50634a58c4
|
|
@ -56,9 +56,9 @@ class Category extends AuthController
|
||||||
public function save($id="")
|
public function save($id="")
|
||||||
{
|
{
|
||||||
$data = Util::postMore([
|
$data = Util::postMore([
|
||||||
['name',''],
|
['title',''],
|
||||||
['pid',0],
|
['pid',0],
|
||||||
['icon',''],
|
['title_en',''],
|
||||||
['module',''],
|
['module',''],
|
||||||
['controller',''],
|
['controller',''],
|
||||||
['action',''],
|
['action',''],
|
||||||
|
|
|
||||||
|
|
@ -172,21 +172,11 @@
|
||||||
$.each(Arr,function (index,item) {
|
$.each(Arr,function (index,item) {
|
||||||
try {
|
try {
|
||||||
switch (item.name) {
|
switch (item.name) {
|
||||||
case 'parent_id':
|
|
||||||
if (!item.value) {
|
|
||||||
throw "上级分类不能为空";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'title':
|
case 'title':
|
||||||
if (!item.value) {
|
if (!item.value) {
|
||||||
throw "分类名称不能为空";
|
throw "分类名称不能为空";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'cover_path':
|
|
||||||
if (!item.value) {
|
|
||||||
throw "主图不能为空";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
lightyear.notify(error, 'danger', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
|
lightyear.notify(error, 'danger', 3000, 'mdi mdi-emoticon-happy', 'top', 'center');
|
||||||
|
|
|
||||||
|
|
@ -172,19 +172,9 @@
|
||||||
$.each(Arr,function (index,item) {
|
$.each(Arr,function (index,item) {
|
||||||
try {
|
try {
|
||||||
switch (item.name) {
|
switch (item.name) {
|
||||||
case 'category_id':
|
|
||||||
if (!item.value) {
|
|
||||||
throw "栏目分类不能为空";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'title':
|
case 'title':
|
||||||
if (!item.value) {
|
if (!item.value) {
|
||||||
throw "文章名称不能为空";
|
throw "分类名称不能为空";
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'cover_path':
|
|
||||||
if (!item.value) {
|
|
||||||
throw "主图不能为空";
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,12 +20,10 @@
|
||||||
"topthink/framework": "^6.0.0",
|
"topthink/framework": "^6.0.0",
|
||||||
"topthink/think-orm": "^2.0",
|
"topthink/think-orm": "^2.0",
|
||||||
"topthink/think-multi-app": "^1.0",
|
"topthink/think-multi-app": "^1.0",
|
||||||
"topthink/think-worker": "^3.0",
|
|
||||||
"topthink/think-view": "^1.0",
|
"topthink/think-view": "^1.0",
|
||||||
"firebase/php-jwt": "^5.0",
|
"firebase/php-jwt": "^5.0",
|
||||||
"xaboy/form-builder": "^2.0",
|
"xaboy/form-builder": "^2.0",
|
||||||
"topthink/think-captcha": "^3.0",
|
"topthink/think-captcha": "^3.0",
|
||||||
"workerman/workerman": "^3.5",
|
|
||||||
"phpmailer/phpmailer": "^6.1",
|
"phpmailer/phpmailer": "^6.1",
|
||||||
"spatie/macroable": "^1.0"
|
"spatie/macroable": "^1.0"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ return [
|
||||||
// 数据库编码默认采用utf8
|
// 数据库编码默认采用utf8
|
||||||
'charset' => env('database.charset', 'utf8'),
|
'charset' => env('database.charset', 'utf8'),
|
||||||
// 数据库表前缀
|
// 数据库表前缀
|
||||||
'prefix' => env('database.prefix', 'lea_'),
|
'prefix' => env('database.prefix', 'ape_'),
|
||||||
|
|
||||||
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
|
// 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器)
|
||||||
'deploy' => 0,
|
'deploy' => 0,
|
||||||
|
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
||||||
<?php
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Copyright (c) 2006-2018 http://thinkphp.cn All rights reserved.
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Author: liu21st <liu21st@gmail.com>
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Workerman设置 仅对 php think worker:gateway 指令有效
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
return [
|
|
||||||
// 扩展自身需要的配置
|
|
||||||
'protocol' => 'websocket', // 协议 支持 tcp udp unix http websocket text
|
|
||||||
'host' => '0.0.0.0', // 监听地址
|
|
||||||
'port' => 2348, // 监听端口
|
|
||||||
'socket' => '', // 完整监听地址
|
|
||||||
'context' => [], // socket 上下文选项
|
|
||||||
'register_deploy' => true, // 是否需要部署register
|
|
||||||
'businessWorker_deploy' => true, // 是否需要部署businessWorker
|
|
||||||
'gateway_deploy' => true, // 是否需要部署gateway
|
|
||||||
|
|
||||||
// Register配置
|
|
||||||
'registerAddress' => '127.0.0.1:1236',
|
|
||||||
|
|
||||||
// Gateway配置
|
|
||||||
'name' => 'thinkphp',
|
|
||||||
'count' => 1,
|
|
||||||
'lanIp' => '127.0.0.1',
|
|
||||||
'startPort' => 2000,
|
|
||||||
'daemonize' => false,
|
|
||||||
'pingInterval' => 30,
|
|
||||||
'pingNotResponseLimit' => 0,
|
|
||||||
'pingData' => '{"type":"ping"}',
|
|
||||||
|
|
||||||
// BusinsessWorker配置
|
|
||||||
'businessWorker' => [
|
|
||||||
'name' => 'BusinessWorker',
|
|
||||||
'count' => 1,
|
|
||||||
'eventHandler' => '\think\worker\Events',
|
|
||||||
],
|
|
||||||
|
|
||||||
];
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
<?php
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Copyright (c) 2006-2018 http://thinkphp.cn All rights reserved.
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Author: liu21st <liu21st@gmail.com>
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Workerman设置 仅对 php think worker 指令有效
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
return [
|
|
||||||
// 扩展自身需要的配置
|
|
||||||
'host' => '0.0.0.0', // 监听地址
|
|
||||||
'port' => 2346, // 监听端口
|
|
||||||
'root' => '', // WEB 根目录 默认会定位public目录
|
|
||||||
'app_path' => '', // 应用目录 守护进程模式必须设置(绝对路径)
|
|
||||||
'file_monitor' => false, // 是否开启PHP文件更改监控(调试模式下自动开启)
|
|
||||||
'file_monitor_interval' => 2, // 文件监控检测时间间隔(秒)
|
|
||||||
'file_monitor_path' => [], // 文件监控目录 默认监控application和config目录
|
|
||||||
|
|
||||||
// 支持workerman的所有配置参数
|
|
||||||
'name' => 'thinkphp',
|
|
||||||
'count' => 1,
|
|
||||||
'daemonize' => false,
|
|
||||||
'pidFile' => '',
|
|
||||||
];
|
|
||||||
|
|
@ -1,58 +0,0 @@
|
||||||
<?php
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Copyright (c) 2006-2018 http://thinkphp.cn All rights reserved.
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Author: liu21st <liu21st@gmail.com>
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
// | Workerman设置 仅对 php think worker:server 指令有效
|
|
||||||
// +----------------------------------------------------------------------
|
|
||||||
return [
|
|
||||||
// 自定义Workerman服务类名 支持数组定义多个服务
|
|
||||||
'worker_class' => ['learn\workerman\admin\WorkerService', 'learn\workerman\chat\WorkerService','learn\workerman\channel\ChannelService','learn\workerman\TimerService'],
|
|
||||||
|
|
||||||
// // 扩展自身需要的配置
|
|
||||||
// 'protocol' => 'websocket', // 协议 支持 tcp udp unix http websocket text
|
|
||||||
// 'host' => '0.0.0.0', // 监听地址
|
|
||||||
// 'port' => 2345, // 监听端口
|
|
||||||
// 'socket' => '', // 完整监听地址
|
|
||||||
// 'context' => [], // socket 上下文选项
|
|
||||||
// 'worker_class' => '', // 自定义Workerman服务类名 支持数组定义多个服务
|
|
||||||
//
|
|
||||||
// // 支持workerman的所有配置参数
|
|
||||||
// 'name' => 'admin',
|
|
||||||
// 'count' => 1,
|
|
||||||
// 'daemonize' => false,
|
|
||||||
// 'pidFile' => '',
|
|
||||||
//
|
|
||||||
// // 支持事件回调
|
|
||||||
// // onWorkerStart
|
|
||||||
// 'onWorkerStart' => function ($worker) {
|
|
||||||
//
|
|
||||||
// },
|
|
||||||
// // onWorkerReload
|
|
||||||
// 'onWorkerReload' => function ($worker) {
|
|
||||||
//
|
|
||||||
// },
|
|
||||||
// // onConnect
|
|
||||||
// 'onConnect' => function ($connection) {
|
|
||||||
//
|
|
||||||
// },
|
|
||||||
// // onMessage
|
|
||||||
// 'onMessage' => function ($connection, $data) {
|
|
||||||
// $connection->send('receive success');
|
|
||||||
// },
|
|
||||||
// // onClose
|
|
||||||
// 'onClose' => function ($connection) {
|
|
||||||
//
|
|
||||||
// },
|
|
||||||
// // onError
|
|
||||||
// 'onError' => function ($connection, $code, $msg) {
|
|
||||||
// echo "error [ $code ] $msg\n";
|
|
||||||
// },
|
|
||||||
];
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
location / {
|
|
||||||
if (!-e $request_filename) {
|
if (!-e $request_filename) {
|
||||||
rewrite ^(.*)$ /index.php?s=/$1 last;
|
rewrite ^(.*)$ /index.php?s=$1 last;
|
||||||
}
|
break;
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue