Initial commit

This commit is contained in:
18338781771
2025-05-14 13:19:23 +08:00
commit 1ab607f65a
313 changed files with 27595 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
use support\Request;
return [
'debug' => true,
'error_reporting' => E_ALL,
'default_timezone' => 'Asia/Shanghai',
'request_class' => Request::class,
'public_path' => base_path() . DIRECTORY_SEPARATOR . 'public',
'runtime_path' => base_path(false) . DIRECTORY_SEPARATOR . 'runtime',
'controller_suffix' => 'Controller',
'controller_reuse' => false,
];
+21
View File
@@ -0,0 +1,21 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [
'files' => [
base_path() . '/app/functions.php',
base_path() . '/support/Request.php',
base_path() . '/support/Response.php',
]
];
+17
View File
@@ -0,0 +1,17 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [
support\bootstrap\Session::class,
];
+15
View File
@@ -0,0 +1,15 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return new Webman\Container;
+29
View File
@@ -0,0 +1,29 @@
<?php
return [
'default' => 'mysql',
'connections' => [
'mysql' => [
'driver' => 'mysql',
'host' => getenv('DB_HOST'),
'port' => getenv('DB_PORT'),
'database' => getenv('DB_NAME'),
'username' => getenv('DB_USER'),
'password' => getenv('DB_PASSWORD'),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'prefix' => getenv('DB_PREFIX'),
'strict' => true,
'engine' => null,
'options' => [
PDO::ATTR_EMULATE_PREPARES => false, // Must be false for Swoole and Swow drivers.
],
'pool' => [
'max_connections' => 5,
'min_connections' => 1,
'wait_timeout' => 3,
'idle_timeout' => 60,
'heartbeat_interval' => 50,
],
],
],
];
+15
View File
@@ -0,0 +1,15 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [];
+17
View File
@@ -0,0 +1,17 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [
'' => support\exception\Handler::class,
];
+32
View File
@@ -0,0 +1,32 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [
'default' => [
'handlers' => [
[
'class' => Monolog\Handler\RotatingFileHandler::class,
'constructor' => [
runtime_path() . '/logs/webman.log',
7, //$maxFiles
Monolog\Logger::DEBUG,
],
'formatter' => [
'class' => Monolog\Formatter\LineFormatter::class,
'constructor' => [null, 'Y-m-d H:i:s', true],
],
]
],
],
];
+28
View File
@@ -0,0 +1,28 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [
'' => [
app\middleware\AccessControl::class
],
'apis' => [
app\middleware\Lang::class
],
'applet' => [
app\middleware\Lang::class
],
'console' => [
app\middleware\Lang::class
]
];
+116
View File
@@ -0,0 +1,116 @@
<?php
/**
*-------------------------------------------------------------------------p*
* 配置文件
*-------------------------------------------------------------------------h*
* @copyright Copyright (c) 2015-2022 Shopwwi Inc. (http://www.shopwwi.com)
*-------------------------------------------------------------------------c*
* @license http://www.shopwwi.com s h o p w w i . c o m
*-------------------------------------------------------------------------e*
* @link http://www.shopwwi.com by 象讯科技 phcent.com
*-------------------------------------------------------------------------n*
* @since shopwwi象讯·PHP商城系统Pro
*-------------------------------------------------------------------------t*
*/
return [
'enable' => true,
'default' => 'local',
'max_size' => 1024 * 1024 * 10, //单个文件大小10M
'ext_yes' => [], //允许上传文件类型 为空则为允许所有
'ext_no' => [], // 不允许上传文件类型 为空则不限制
'storage' => [
'public' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\LocalAdapterFactory::class,
'root' => public_path(),
'url' => '//127.0.0.1:8787' // 静态文件访问域名
],
'local' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\LocalAdapterFactory::class,
'root' => runtime_path(),
'url' => '//127.0.0.1:8787' // 静态文件访问域名
],
'ftp' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\FtpAdapterFactory::class,
'host' => 'ftp.example.com',
'username' => 'username',
'password' => 'password',
'url' => '' // 静态文件访问域名
// 'port' => 21,
// 'root' => '/path/to/root',
// 'passive' => true,
// 'ssl' => true,
// 'timeout' => 30,
// 'ignorePassiveAddress' => false,
// 'timestampsOnUnixListingsEnabled' => true,
],
'memory' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\MemoryAdapterFactory::class,
],
's3' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\S3AdapterFactory::class,
'credentials' => [
'key' => 'S3_KEY',
'secret' => 'S3_SECRET',
],
'region' => 'S3_REGION',
'version' => 'latest',
'bucket_endpoint' => false,
'use_path_style_endpoint' => false,
'endpoint' => 'S3_ENDPOINT',
'bucket_name' => 'S3_BUCKET',
'url' => '' // 静态文件访问域名
],
'minio' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\S3AdapterFactory::class,
'credentials' => [
'key' => 'S3_KEY',
'secret' => 'S3_SECRET',
],
'region' => 'S3_REGION',
'version' => 'latest',
'bucket_endpoint' => false,
'use_path_style_endpoint' => true,
'endpoint' => 'S3_ENDPOINT',
'bucket_name' => 'S3_BUCKET',
'url' => '' // 静态文件访问域名
],
'oss' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\AliyunOssAdapterFactory::class,
'accessId' => getenv('OSS_ACCESSID'),
'accessSecret' => getenv('OSS_ACCESSSECRET'),
'bucket' => getenv('OSS_BUCKET'),
'endpoint' => getenv('OSS_ENDPOINT'),
'url' => getenv('OSS_STATIC_URL') // 静态文件访问域名
// 'timeout' => 3600,
// 'connectTimeout' => 10,
// 'isCName' => false,
// 'token' => null,
// 'proxy' => null,
],
'qiniu' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\QiniuAdapterFactory::class,
'accessKey' => 'QINIU_ACCESS_KEY',
'secretKey' => 'QINIU_SECRET_KEY',
'bucket' => 'QINIU_BUCKET',
'domain' => 'QINBIU_DOMAIN',
'url' => '' // 静态文件访问域名
],
'cos' => [
'driver' => \Shopwwi\WebmanFilesystem\Adapter\CosAdapterFactory::class,
'region' => 'COS_REGION',
'app_id' => 'COS_APPID',
'secret_id' => 'COS_SECRET_ID',
'secret_key' => 'COS_SECRET_KEY',
// 可选,如果 bucket 为私有访问请打开此项
// 'signed_url' => false,
'bucket' => 'COS_BUCKET',
'read_from_cdn' => false,
'url' => '' // 静态文件访问域名
// 'timeout' => 60,
// 'connect_timeout' => 60,
// 'cdn' => '',
// 'scheme' => 'https',
],
],
];
+24
View File
@@ -0,0 +1,24 @@
<?php
return [
'enable' => true,
'build_dir' => BASE_PATH . DIRECTORY_SEPARATOR . 'build',
'phar_filename' => 'webman.phar',
'bin_filename' => 'webman.bin',
'signature_algorithm'=> Phar::SHA256, //set the signature algorithm for a phar and apply it. The signature algorithm must be one of Phar::MD5, Phar::SHA1, Phar::SHA256, Phar::SHA512, or Phar::OPENSSL.
'private_key_file' => '', // The file path for certificate or OpenSSL private key file.
'exclude_pattern' => '#^(?!.*(composer.json|/.github/|/.idea/|/.git/|/.setting/|/runtime/|/vendor-bin/|/build/|/vendor/webman/admin/))(.*)$#',
'exclude_files' => [
'.env', 'LICENSE', 'composer.json', 'composer.lock', 'start.php', 'webman.phar', 'webman.bin'
],
'custom_ini' => '
memory_limit = 256M
',
];
+4
View File
@@ -0,0 +1,4 @@
<?php
return [
'enable' => true,
];
@@ -0,0 +1,7 @@
<?php
use Webman\RedisQueue\Command\MakeConsumerCommand;
return [
MakeConsumerCommand::class
];
+32
View File
@@ -0,0 +1,32 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [
'default' => [
'handlers' => [
[
'class' => Monolog\Handler\RotatingFileHandler::class,
'constructor' => [
runtime_path() . '/logs/redis-queue/queue.log',
7, //$maxFiles
Monolog\Logger::DEBUG,
],
'formatter' => [
'class' => Monolog\Formatter\LineFormatter::class,
'constructor' => [null, 'Y-m-d H:i:s', true],
],
]
],
]
];
@@ -0,0 +1,12 @@
<?php
return [
'consumer' => [
'handler' => Webman\RedisQueue\Process\Consumer::class,
'count' => getenv('REDIS_QUEUE_PROCESS_COUNT'), // 可以设置多进程同时消费
'constructor' => [
// 消费者类目录
// 'consumer_dir' => app_path() . '/queue/redis'
'consumer_dir' => app_path() . getenv('REDIS_QUEUE_CONSUMER_DIR')
]
]
];
@@ -0,0 +1,21 @@
<?php
return [
'default' => [
'host' => getenv('REDIS_QUEUE_HOST'),
'options' => [
'auth' => getenv('REDIS_QUEUE_AUTH'),
'db' => getenv('REDIS_QUEUE_DB'),
'prefix' => getenv('REDIS_QUEUE_PREFIX'),
'max_attempts' => getenv('REDIS_QUEUE_MAX_ATTEMPTS'),
'retry_seconds' => getenv('REDIS_QUEUE_RETRY_SECONDS'),
],
// Connection pool, supports only Swoole or Swow drivers.
'pool' => [
'max_connections' => 5,
'min_connections' => 1,
'wait_timeout' => 3,
'idle_timeout' => 60,
'heartbeat_interval' => 50,
]
],
];
+62
View File
@@ -0,0 +1,62 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
use support\Log;
use support\Request;
use app\process\Http;
global $argv;
return [
'webman' => [
'handler' => Http::class,
'listen' => 'http://0.0.0.0:'.getenv('PROCESS_LISTEN'),
'count' => getenv('PROCESS_COUNT'),
'user' => '',
'group' => '',
'reusePort' => false,
'eventLoop' => '',
'context' => [],
'constructor' => [
'requestClass' => Request::class,
'logger' => Log::channel('default'),
'appPath' => app_path(),
'publicPath' => public_path()
]
],
// File update detection and automatic reload
'monitor' => [
'handler' => app\process\Monitor::class,
'reloadable' => false,
'constructor' => [
// Monitor these directories
'monitorDir' => array_merge([
app_path(),
config_path(),
base_path() . '/process',
base_path() . '/support',
base_path() . '/resource',
base_path() . '/.env',
], glob(base_path() . '/plugin/*/app'), glob(base_path() . '/plugin/*/config'), glob(base_path() . '/plugin/*/api')),
// Files with these suffixes will be monitored
'monitorExtensions' => [
'php', 'html', 'htm', 'env'
],
'options' => [
'enable_file_monitor' => !in_array('-d', $argv) && DIRECTORY_SEPARATOR === '/',
'enable_memory_monitor' => DIRECTORY_SEPARATOR === '/',
]
]
]
];
+29
View File
@@ -0,0 +1,29 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [
'default' => [
'password' => getenv('REDIS_PASSWORD'),
'host' => getenv('REDIS_HOST'),
'port' => getenv('REDIS_PORT'),
'database' => getenv('REDIS_DATABASE'),
'pool' => [
'max_connections' => 5,
'min_connections' => 1,
'wait_timeout' => 3,
'idle_timeout' => 60,
'heartbeat_interval' => 50,
],
]
];
+184
View File
@@ -0,0 +1,184 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
use Webman\Route;
// ****** ****** ****** 生成文件({模块}/{名称}) ****** ****** ******
Route::any('/cf/{module}/{name}', [\app\mzl\MzlController::class, 'createFile']);
// ****** ****** ****** 生成文件({模块}/{名称}) ****** ****** ******
// ====== ====== ====== 网站 ====== ====== ======
Route::group('/apis', function() {
// 车辆列表
Route::any('/vehicle/list', [\app\apis\controller\VehicleDataController::class, 'index']);
// 车辆详情
Route::any('/vehicle/detail', [\app\apis\controller\VehicleDataController::class, 'show']);
// 联系方式
Route::any('/contact/add', [\app\apis\controller\ContactsController::class, 'store']);
// 搜索项
Route::any('/search/options', [\app\apis\controller\DictTypeController::class, 'options']);
// 搜索项 - 型号
Route::any('/get/models', [\app\apis\controller\DictTypeController::class, 'getModels']);
// 油箱订阅
Route::any('/email/subscribe', [\app\apis\controller\SubscribeController::class, 'store']);
// 车辆类型
Route::any('/vehicle/types', [\app\apis\controller\TypesController::class, 'all']);
// 车辆随机
Route::any('/vehicle/random', [\app\apis\controller\VehicleDataController::class, 'random']);
// 隐私协议
Route::any('/agt/privacy', [\app\apis\controller\AgreementController::class, 'one']);
});
// ====== ====== ====== 网站 ====== ====== ======
// ====== ====== ====== 小程序 ====== ====== ======
Route::group('/applet', function() {
// 品牌
Route::get('/brand', [\app\applet\controller\BrandController::class, 'all']);
// 类型
Route::get('/types', [\app\applet\controller\TypesController::class, 'all']);
// 能源
Route::get('/energy', [\app\applet\controller\EnergyController::class, 'all']);
// 型号
Route::get('/models', [\app\applet\controller\ModelController::class, 'all']);
// 协议
Route::get('/agreement/{agt}', [\app\applet\controller\AgreementController::class, 'getOne']);
// 登录
Route::post('/miniapp/login', [\app\applet\controller\UsersController::class, 'miniappLogin']);
// 手机号
Route::post('/miniapp/phone', [\app\applet\controller\UsersController::class, 'miniappPhoneNumber'])->middleware([
\app\mzl\modules\jwt\middleware\JwtMiddleware::class
]);
// // 用户 - 信息
// Route::post('/user/info', [\app\applet\controller\UsersController::class, 'one'])->middleware([
// \app\mzl\modules\jwt\middleware\JwtMiddleware::class
// ]);
// 授权
Route::group('/', function() {
// 用户 - 信息
Route::post('user/info', [\app\applet\controller\UsersController::class, 'one']);
// 用户 - 更新
Route::post('user/update', [\app\applet\controller\UsersController::class, 'updateData']);
// 车辆 - 添加
Route::post('vehicle/add', [\app\applet\controller\VehicleDataController::class, 'add']);
// 车辆 - 更新
Route::post('vehicle/update/{id}', [\app\applet\controller\VehicleDataController::class, 'edit']);
// 车辆 - 详情
Route::get('vehicle/detail/{id}', [\app\applet\controller\VehicleDataController::class, 'show']);
// 车辆 - 列表
Route::get('vehicle/list', [\app\applet\controller\VehicleDataController::class, 'index']);
// 车辆 - 删除
Route::post('vehicle/delete/{id}', [\app\applet\controller\VehicleDataController::class, 'destroy']);
// // 车辆 - 申请
// Route::post('vehicle/apply/status', [\app\applet\controller\VehicleApplyController::class, 'getOne']);
// // 草稿 - 添加
// Route::post('draft/add', [\app\applet\controller\DraftsController::class, 'addData']);
// // 草稿 - 更新
// Route::post('draft/update/{draftId}', [\app\applet\controller\DraftsController::class, 'updateData']);
// // 草稿 - 详情
// Route::get('draft/detail/{draftId}', [\app\applet\controller\DraftsController::class, 'getOne']);
// // 草稿 - 列表
// Route::get('draft/list', [\app\applet\controller\DraftsController::class, 'pageLists']);
// // 草稿 - 删除
// Route::post('draft/delete', [\app\applet\controller\DraftsController::class, 'deleteData']);
})->middleware([
\app\mzl\modules\jwt\middleware\JwtMiddleware::class
]);
});
// ====== ====== ====== 小程序 ====== ====== ======
// ====== ====== ====== 后台管理 ====== ====== ======
Route::group('/console', function() {
// 协议管理
Route::any('/agt/list', [\app\console\controller\AgreementController::class, 'index']);
Route::any('/agt/add', [\app\console\controller\AgreementController::class, 'add']);
Route::any('/agt/{id}/update', [\app\console\controller\AgreementController::class, 'edit']);
Route::any('/agt/{id}/delete', [\app\console\controller\AgreementController::class, 'destroy']);
Route::any('/agt/{id}/detail', [\app\console\controller\AgreementController::class, 'show']);
// 品牌管理
Route::any('/brand/list', [\app\console\controller\BrandController::class, 'index']);
Route::any('/brand/add', [\app\console\controller\BrandController::class, 'add']);
Route::any('/brand/{id}/update', [\app\console\controller\BrandController::class, 'edit']);
Route::any('/brand/{id}/delete', [\app\console\controller\BrandController::class, 'destroy']);
Route::any('/brand/{id}/detail', [\app\console\controller\BrandController::class, 'show']);
Route::any('/brand/preset', [\app\console\controller\BrandController::class, 'presets']);
// 能源管理
Route::any('/energy/list', [\app\console\controller\EnergyController::class, 'index']);
Route::any('/energy/add', [\app\console\controller\EnergyController::class, 'add']);
Route::any('/energy/{id}/update', [\app\console\controller\EnergyController::class, 'edit']);
Route::any('/energy/{id}/delete', [\app\console\controller\EnergyController::class, 'destroy']);
Route::any('/energy/{id}/detail', [\app\console\controller\EnergyController::class, 'show']);
Route::any('/energy/preset', [\app\console\controller\EnergyController::class, 'presets']);
// 类型管理
Route::any('/types/list', [\app\console\controller\TypesController::class, 'index']);
Route::any('/types/add', [\app\console\controller\TypesController::class, 'add']);
Route::any('/types/{id}/update', [\app\console\controller\TypesController::class, 'edit']);
Route::any('/types/{id}/delete', [\app\console\controller\TypesController::class, 'destroy']);
Route::any('/types/{id}/detail', [\app\console\controller\TypesController::class, 'show']);
Route::any('/types/preset', [\app\console\controller\TypesController::class, 'presets']);
// 用户管理
Route::any('/users/list', [\app\console\controller\UsersController::class, 'index']);
Route::any('/users/{id}/update', [\app\console\controller\UsersController::class, 'update']);
Route::any('/users/{id}/delete', [\app\console\controller\UsersController::class, 'destroy']);
Route::any('/users/{id}/detail', [\app\console\controller\UsersController::class, 'show']);
// 车辆信息管理
Route::any('/vehicle/data/list', [\app\console\controller\VehicleDataController::class, 'index']);
Route::any('/vehicle/add', [\app\console\controller\VehicleDataController::class, 'add']);
Route::any('/vehicle/{id}/update', [\app\console\controller\VehicleDataController::class, 'edit']);
Route::any('/vehicle/data/{id}/do', [\app\console\controller\VehicleDataController::class, 'doSaled']);
Route::any('/vehicle/data/{id}/delete', [\app\console\controller\VehicleDataController::class, 'destroy']);
Route::any('/vehicle/data/{id}/detail', [\app\console\controller\VehicleDataController::class, 'detail']);
// 上传
Route::any('/upload/image', [\app\mzl\modules\upload\controller\UploadController::class, 'uploadImage']);
// 型号管理
Route::any('/models/list', [\app\console\controller\ModelController::class, 'index']);
Route::any('/models/add', [\app\console\controller\ModelController::class, 'add']);
Route::any('/models/{id}/update', [\app\console\controller\ModelController::class, 'edit']);
Route::any('/models/{id}/delete', [\app\console\controller\ModelController::class, 'destroy']);
Route::any('/models/{id}/detail', [\app\console\controller\ModelController::class, 'show']);
Route::any('/models/preset', [\app\console\controller\ModelController::class, 'presets']);
// 审核管理
Route::any('/apply/list', [\app\console\controller\VehicleApplyController::class, 'index']);
Route::any('/apply/{id}/do', [\app\console\controller\VehicleApplyController::class, 'doApply']);
Route::any('/apply/{id}/delete', [\app\console\controller\VehicleApplyController::class, 'destroy']);
Route::any('/apply/{id}/detail', [\app\console\controller\VehicleApplyController::class, 'show']);
// 首页统计
Route::any('/counts', [\app\console\controller\HomeController::class, 'datas']);
// 位置管理
Route::any('/location/list', [\app\console\controller\LocationController::class, 'index']);
Route::any('/location/add', [\app\console\controller\LocationController::class, 'add']);
Route::any('/location/{id}/update', [\app\console\controller\LocationController::class, 'edit']);
Route::any('/location/{id}/delete', [\app\console\controller\LocationController::class, 'destroy']);
Route::any('/location/{id}/detail', [\app\console\controller\LocationController::class, 'show']);
Route::any('/location/preset', [\app\console\controller\LocationController::class, 'presets']);
});
// ====== ====== ====== 后台管理 ====== ====== ======
+23
View File
@@ -0,0 +1,23 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
return [
'event_loop' => '',
'stop_timeout' => 2,
'pid_file' => runtime_path() . '/webman.pid',
'status_file' => runtime_path() . '/webman.status',
'stdout_file' => runtime_path() . '/logs/stdout.log',
'log_file' => runtime_path() . '/logs/workerman.log',
'max_package_size' => 10 * 1024 * 1024
];
+65
View File
@@ -0,0 +1,65 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
use Webman\Session\FileSessionHandler;
use Webman\Session\RedisSessionHandler;
use Webman\Session\RedisClusterSessionHandler;
return [
'type' => 'file', // or redis or redis_cluster
'handler' => FileSessionHandler::class,
'config' => [
'file' => [
'save_path' => runtime_path() . '/sessions',
],
'redis' => [
'host' => '127.0.0.1',
'port' => 6379,
'auth' => '',
'timeout' => 2,
'database' => '',
'prefix' => 'redis_session_',
],
'redis_cluster' => [
'host' => ['127.0.0.1:7000', '127.0.0.1:7001', '127.0.0.1:7001'],
'timeout' => 2,
'auth' => '',
'prefix' => 'redis_session_',
]
],
'session_name' => 'PHPSID',
'auto_update_timestamp' => false,
'lifetime' => 7*24*60*60,
'cookie_lifetime' => 365*24*60*60,
'cookie_path' => '/',
'domain' => '',
'http_only' => true,
'secure' => false,
'same_site' => '',
'gc_probability' => [1, 1000],
];
+23
View File
@@ -0,0 +1,23 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
/**
* Static file settings
*/
return [
'enable' => true,
'middleware' => [ // Static file Middleware
//app\middleware\StaticFile::class,
],
];
+25
View File
@@ -0,0 +1,25 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
/**
* Multilingual configuration
*/
return [
// Default language
'locale' => 'zh',
// Fallback language
'fallback_locale' => ['zh', 'en'],
// Folder where language files are stored
'path' => base_path() . '/resource/translations',
];
+22
View File
@@ -0,0 +1,22 @@
<?php
/**
* This file is part of webman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://www.workerman.net/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
use support\view\Raw;
use support\view\Twig;
use support\view\Blade;
use support\view\ThinkPHP;
return [
'handler' => Raw::class
];