diff --git a/app/common.php b/app/common.php index 563ad31..f932179 100644 --- a/app/common.php +++ b/app/common.php @@ -10,6 +10,8 @@ use think\facade\Event; use think\facade\Filesystem; use think\route\Url; +include_once __DIR__ . '/app/common/app/functions.php'; + if (!function_exists('__url')) { /** * 构建URL地址 diff --git a/app/common/app/functions.php b/app/common/app/functions.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/app/common/app/functions.php @@ -0,0 +1 @@ + \think\middleware\SessionInit::class, ]; + +$middleware_common = include_once __DIR__ . '/app/common/app/middleware.php'; + +$middleware = array_merge($middleware_default, $middleware_common); + +return ksort($middleware); diff --git a/app/provider.php b/app/provider.php index 2d2febf..bfde3e0 100644 --- a/app/provider.php +++ b/app/provider.php @@ -6,8 +6,12 @@ use app\common\provider\ExceptionHandle; use app\common\provider\Request; use app\common\provider\View; -return [ +$provider_default = [ 'think\Request' => Request::class, 'think\exception\Handle' => ExceptionHandle::class, 'think\View' => View::class, ]; + +$provider_common = include_once __DIR__ . '/app/common/app/provider.php'; + +return array_merge($provider_default, $provider_common); diff --git a/app/service.php b/app/service.php index d6df24b..790b881 100644 --- a/app/service.php +++ b/app/service.php @@ -1,7 +1,14 @@ 'think\\captcha\\CaptchaService', 1 => 'think\\app\\Service', -]; \ No newline at end of file +]; + +$service_common = include_once __DIR__ . '/app/common/app/service.php'; + +$service = array_merge($service_default, $service_common); + +return ksort($service); diff --git a/config/update.php b/config/update.php new file mode 100644 index 0000000..8a1b5ed --- /dev/null +++ b/config/update.php @@ -0,0 +1,14 @@ +