From 558ad1271b3d4f91655c45044519668bb63c65b6 Mon Sep 17 00:00:00 2001 From: JaguarJack Date: Mon, 6 Nov 2023 18:30:38 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=A8=A1=E5=9D=97=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/Develop/Support/Generate/Module.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/Develop/Support/Generate/Module.php b/modules/Develop/Support/Generate/Module.php index 4278cc9..bbcd317 100644 --- a/modules/Develop/Support/Generate/Module.php +++ b/modules/Develop/Support/Generate/Module.php @@ -81,6 +81,13 @@ class Module */ protected function createRoute(): void { - File::copy(__DIR__.DIRECTORY_SEPARATOR.'stubs'.DIRECTORY_SEPARATOR.'route.stub', CatchAdmin::getModuleRoutePath($this->module)); + $content = Str::of( + File::get(__DIR__.DIRECTORY_SEPARATOR.'stubs'.DIRECTORY_SEPARATOR.'route.stub') + )->replace(['{module}'], [lcfirst($this->module)]); + + File::put( + CatchAdmin::getModuleRoutePath($this->module), + $content + ); } }