diff --git a/app/common/command/build/Dist.php b/app/common/command/build/Dist.php index e92cb83..ca9db10 100644 --- a/app/common/command/build/Dist.php +++ b/app/common/command/build/Dist.php @@ -561,7 +561,7 @@ class Dist extends Command */ public function buildAllAppDir() { - $list = $this->appFilesystem->listContents(''); + $list = $this->appFilesystem->listContents('app'); foreach ($list as $item) { if ($item['type'] != 'dir') { diff --git a/app/common/tools/phpparser/ReadEnvVisitorNodeTools.php b/app/common/tools/phpparser/ReadEnvVisitorNodeTools.php index bbf3423..09d2fc1 100644 --- a/app/common/tools/phpparser/ReadEnvVisitorNodeTools.php +++ b/app/common/tools/phpparser/ReadEnvVisitorNodeTools.php @@ -18,6 +18,7 @@ use PhpParser\Node\Scalar\LNumber; use PhpParser\Node\Scalar\String_; use PhpParser\NodeTraverser; use PhpParser\NodeVisitorAbstract; +use think\facade\Config; class ReadEnvVisitorNodeTools extends NodeVisitorAbstract { @@ -99,9 +100,14 @@ class ReadEnvVisitorNodeTools extends NodeVisitorAbstract return new Array_($value); } else if (is_string($value)) { - return new FuncCall(new Name('base64_decode'), [ - new Arg(new String_(base64_encode($value))) - ]); + + $env_pack_mode = Config::get('dist.pack_env_mode'); + + if ($env_pack_mode == 0) { + return new FuncCall(new Name('base64_decode'), [ + new Arg(new String_(base64_encode($value))) + ]); + } return new String_($value); } else if (is_integer($value)) { diff --git a/config/dist.php b/config/dist.php index 8d9b457..2422cbb 100644 --- a/config/dist.php +++ b/config/dist.php @@ -29,16 +29,18 @@ return [ '/config.php/', '/^public\/index\.php/', '/^public\/router\.php/', - + '/^app\/admin\/service\/initAdminData\/*/', ], // 希望将env打包的文件 - 'pack_env_path'=>[ + 'pack_env_path' => [ '/^app/', '/^config/', '/^database/', '/^extend/', '/^lib/', '/^route/', - ] + ], + // 0:base64方式处理,1:明文打包 + 'pack_env_mode' => 1 ];