diff --git a/app/admin/controller/api/Update.php b/app/admin/controller/api/Update.php index 958bd7a07..570deb46f 100644 --- a/app/admin/controller/api/Update.php +++ b/app/admin/controller/api/Update.php @@ -47,7 +47,7 @@ class Update extends Controller if (!ModuleService::checkAllowDownload($filename)) { $this->error('下载的文件不在认证规则中!'); } - if (file_exists($realname = $this->app->getRootPath() . $filename)) { + if (file_exists($realname = with_path($filename))) { $this->success('读取文件内容成功!', [ 'content' => base64_encode(file_get_contents($realname)), ]); diff --git a/app/data/command/UserTransfer.php b/app/data/command/UserTransfer.php index 5b5f4129a..39cbdf848 100644 --- a/app/data/command/UserTransfer.php +++ b/app/data/command/UserTransfer.php @@ -136,7 +136,7 @@ class UserTransfer extends Command 'mch_key' => $data['wechat_mch_key'], 'ssl_key' => $local->path($file1, true), 'ssl_cer' => $local->path($file2, true), - 'cache_path' => $this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . 'wechat', + 'cache_path' => with_path('runtime/wechat'), ]; } diff --git a/app/data/controller/api/Wxapp.php b/app/data/controller/api/Wxapp.php index 9df24a60b..c0f80d273 100644 --- a/app/data/controller/api/Wxapp.php +++ b/app/data/controller/api/Wxapp.php @@ -47,7 +47,7 @@ class Wxapp extends Controller $this->config = [ 'appid' => $option['appid'] ?? '', 'appsecret' => $option['appkey'] ?? '', - 'cache_path' => $this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . 'wechat', + 'cache_path' => with_path('runtime/wechat'), ]; if (empty(UserAdminService::TYPES[$this->type]['auth'])) { $this->error("接口类型[{$this->type}]没有定义规则"); diff --git a/app/data/service/payment/WechatPaymentService.php b/app/data/service/payment/WechatPaymentService.php index 4adf5b686..463c87683 100644 --- a/app/data/service/payment/WechatPaymentService.php +++ b/app/data/service/payment/WechatPaymentService.php @@ -115,7 +115,7 @@ class WechatPaymentService extends PaymentService 'appid' => $this->params['wechat_appid'], 'mch_id' => $this->params['wechat_mch_id'], 'mch_key' => $this->params['wechat_mch_key'], - 'cache_path' => $this->app->getRootPath() . 'runtime' . DIRECTORY_SEPARATOR . 'wechat', + 'cache_path' => with_path('runtime/wechat'), ]); return $this; }