From 50634a58c4aca39d94af6390e790109f0b078007 Mon Sep 17 00:00:00 2001 From: muzi_yd <1099438829@qq.com> Date: Wed, 10 Mar 2021 23:58:29 +0800 Subject: [PATCH] update --- app/admin/controller/Category.php | 4 +-- app/admin/view/category/add.html | 10 ------ app/admin/view/category/edit.html | 12 +------ composer.json | 2 -- config/database.php | 2 +- config/gateway_worker.php | 45 ------------------------ config/worker.php | 30 ---------------- config/worker_server.php | 58 ------------------------------- public/nginx.htaccess | 9 +++-- 9 files changed, 8 insertions(+), 164 deletions(-) delete mode 100644 config/gateway_worker.php delete mode 100644 config/worker.php delete mode 100644 config/worker_server.php diff --git a/app/admin/controller/Category.php b/app/admin/controller/Category.php index e67ccb6..31851bb 100644 --- a/app/admin/controller/Category.php +++ b/app/admin/controller/Category.php @@ -56,9 +56,9 @@ class Category extends AuthController public function save($id="") { $data = Util::postMore([ - ['name',''], + ['title',''], ['pid',0], - ['icon',''], + ['title_en',''], ['module',''], ['controller',''], ['action',''], diff --git a/app/admin/view/category/add.html b/app/admin/view/category/add.html index 3f6dd37..16c939c 100644 --- a/app/admin/view/category/add.html +++ b/app/admin/view/category/add.html @@ -172,21 +172,11 @@ $.each(Arr,function (index,item) { try { switch (item.name) { - case 'parent_id': - if (!item.value) { - throw "上级分类不能为空"; - } - break; case 'title': if (!item.value) { throw "分类名称不能为空"; } break; - case 'cover_path': - if (!item.value) { - throw "主图不能为空"; - } - break; } } catch (error) { lightyear.notify(error, 'danger', 3000, 'mdi mdi-emoticon-happy', 'top', 'center'); diff --git a/app/admin/view/category/edit.html b/app/admin/view/category/edit.html index 13cdf29..2e1cc00 100644 --- a/app/admin/view/category/edit.html +++ b/app/admin/view/category/edit.html @@ -172,19 +172,9 @@ $.each(Arr,function (index,item) { try { switch (item.name) { - case 'category_id': - if (!item.value) { - throw "栏目分类不能为空"; - } - break; case 'title': if (!item.value) { - throw "文章名称不能为空"; - } - break; - case 'cover_path': - if (!item.value) { - throw "主图不能为空"; + throw "分类名称不能为空"; } break; } diff --git a/composer.json b/composer.json index ee1bf6f..e433ed1 100644 --- a/composer.json +++ b/composer.json @@ -20,12 +20,10 @@ "topthink/framework": "^6.0.0", "topthink/think-orm": "^2.0", "topthink/think-multi-app": "^1.0", - "topthink/think-worker": "^3.0", "topthink/think-view": "^1.0", "firebase/php-jwt": "^5.0", "xaboy/form-builder": "^2.0", "topthink/think-captcha": "^3.0", - "workerman/workerman": "^3.5", "phpmailer/phpmailer": "^6.1", "spatie/macroable": "^1.0" }, diff --git a/config/database.php b/config/database.php index 3ff228f..e97ac7f 100644 --- a/config/database.php +++ b/config/database.php @@ -35,7 +35,7 @@ return [ // 数据库编码默认采用utf8 'charset' => env('database.charset', 'utf8'), // 数据库表前缀 - 'prefix' => env('database.prefix', 'lea_'), + 'prefix' => env('database.prefix', 'ape_'), // 数据库部署方式:0 集中式(单一服务器),1 分布式(主从服务器) 'deploy' => 0, diff --git a/config/gateway_worker.php b/config/gateway_worker.php deleted file mode 100644 index 21d1ebe..0000000 --- a/config/gateway_worker.php +++ /dev/null @@ -1,45 +0,0 @@ - -// +---------------------------------------------------------------------- -// +---------------------------------------------------------------------- -// | 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', - ], - -]; diff --git a/config/worker.php b/config/worker.php deleted file mode 100644 index f40bd24..0000000 --- a/config/worker.php +++ /dev/null @@ -1,30 +0,0 @@ - -// +---------------------------------------------------------------------- - -// +---------------------------------------------------------------------- -// | 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' => '', -]; diff --git a/config/worker_server.php b/config/worker_server.php deleted file mode 100644 index b1bbc00..0000000 --- a/config/worker_server.php +++ /dev/null @@ -1,58 +0,0 @@ - -// +---------------------------------------------------------------------- - -// +---------------------------------------------------------------------- -// | 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"; -// }, -]; diff --git a/public/nginx.htaccess b/public/nginx.htaccess index e925584..be426e9 100644 --- a/public/nginx.htaccess +++ b/public/nginx.htaccess @@ -1,5 +1,4 @@ -location / { - if (!-e $request_filename) { - rewrite ^(.*)$ /index.php?s=/$1 last; - } -} \ No newline at end of file +if (!-e $request_filename) { + rewrite ^(.*)$ /index.php?s=$1 last; + break; + } \ No newline at end of file