diff --git a/app/common/service/generator/core/VueIndexGenerator.php b/app/common/service/generator/core/VueIndexGenerator.php index a3c5b4f..bcd4224 100644 --- a/app/common/service/generator/core/VueIndexGenerator.php +++ b/app/common/service/generator/core/VueIndexGenerator.php @@ -59,6 +59,7 @@ class VueIndexGenerator extends BaseGenerator implements GenerateInterface $this->getQueryParamsContent(), $this->getDictDataContent(), $this->getPkContent(), + $this->getApiDirContent(), $this->getTableName(), $this->getPermsContent(), $this->getPermsContent('edit'), @@ -257,7 +258,11 @@ class VueIndexGenerator extends BaseGenerator implements GenerateInterface */ public function getModuleGenerateDir() { - $dir = dirname(app()->getRootPath()) . '/admin/src/views/' . $this->getLowerTableName() . '/'; + $dir = dirname(app_path()) . '/admin/src/views/'; + if (!empty($this->classDir) && $this->classDir != $this->getLowerTableName()) { + $dir .= $this->classDir . '/'; + }; + $dir .= $this->getLowerTableName() . '/'; $this->checkDir($dir); return $dir; } @@ -271,7 +276,11 @@ class VueIndexGenerator extends BaseGenerator implements GenerateInterface */ public function getRuntimeGenerateDir() { - $dir = $this->generatorDir . 'vue/src/views/' . $this->getLowerTableName() . '/'; + $dir = $this->generatorDir . 'vue/src/views/'; + if (!empty($this->classDir) && $this->classDir != $this->getLowerTableName()) { + $dir .= $this->classDir . '/'; + }; + $dir .= $this->getLowerTableName() . '/'; $this->checkDir($dir); return $dir; }