release
parent
dff1c08113
commit
cf584de24a
|
|
@ -17,23 +17,16 @@ class WangEditoController extends Controller
|
|||
$dir = $request->get('dir', 'wang-editor');
|
||||
$disk = $this->disk();
|
||||
|
||||
$newName = $this->generateNewName($file);
|
||||
|
||||
$disk->putFileAs($dir, $file, $newName);
|
||||
$path = $disk->putFile($dir, $file);
|
||||
|
||||
return [
|
||||
'errno' => 0,
|
||||
'data' => [
|
||||
'url' => $disk->url("{$dir}/$newName")
|
||||
'url' => $disk->url($path)
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
protected function generateNewName(UploadedFile $file): string
|
||||
{
|
||||
return uniqid(md5($file->getClientOriginalName())).'.'.$file->getClientOriginalExtension();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Filesystem|FilesystemAdapter
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -49,7 +49,8 @@ class DistributeService
|
|||
$level_up = $item;
|
||||
}
|
||||
}
|
||||
if ($level_up && $level_up->sort < $user_agent->sort) {
|
||||
// 如果当前等级, 比升级之后的要高, 则不升级
|
||||
if ($level_up && (!$user_agent || $level_up->sort < $user_agent->sort)) {
|
||||
$user->update([
|
||||
'agent_id' => $level_up->id,
|
||||
]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue