mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-07-09 11:32:48 +08:00
去除大多数文件的外部功能依赖;
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user