去除大多数文件的外部功能依赖;

This commit is contained in:
2022-07-12 11:00:47 +08:00
parent ef6fd7bfbc
commit 4ab8630617
8 changed files with 43 additions and 62 deletions

View File

@@ -4,7 +4,6 @@
namespace app\common\service;
use app\common\constants\AdminConstant;
use EasyAdmin\tool\CommonTool;
use think\facade\Config;
use think\facade\Db;
@@ -200,7 +199,7 @@ class AuthService
if ($key == 0) {
$val = explode('.', $val);
foreach ($val as &$vo) {
$vo = CommonTool::humpToLine(lcfirst($vo));
$vo = \think\helper\Str::snake(lcfirst($vo));
}
$val = implode('.', $val);
$array[$key] = $val;

View File

@@ -56,7 +56,7 @@ class UploadService
return $url;
}
public function save(File $file)
public function save(File $file, string $save_name = null)
{
$model_file = new SystemUploadfile();
@@ -74,8 +74,10 @@ class UploadService
$model_file->mime_type = $file->getMime();
}
$save_name = Filesystem::disk($this->uploadType)->putFile('upload', $file, function () {
$save_name = Filesystem::disk($this->uploadType)->putFile('upload', $file, function () use ($save_name) {
if (!is_null($save_name)) {
return $save_name;
}
return date('Ymd') . '/' . uniqid();
});