mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2025-01-18 13:54:01 +08:00
fix minor bugs caused by batch-import plugin
This commit is contained in:
parent
177c25bfb4
commit
fb64056cbd
@ -3,7 +3,7 @@
|
||||
namespace App\Services;
|
||||
|
||||
use Log;
|
||||
use Storage;
|
||||
use Storage as LaravelStorage;
|
||||
use App\Exceptions\PrettyPageException;
|
||||
|
||||
class Utils
|
||||
@ -47,8 +47,8 @@ class Utils
|
||||
if (file_exists($absolute_path)) {
|
||||
$hash = hash_file('sha256', $absolute_path);
|
||||
|
||||
if (!Storage::disk('textures')->has($hash)) {
|
||||
Storage::disk('textures')->move($path, $hash);
|
||||
if (!LaravelStorage::disk('textures')->has($hash)) {
|
||||
LaravelStorage::disk('textures')->move($path, $hash);
|
||||
} else {
|
||||
// delete the temp file
|
||||
unlink($absolute_path);
|
||||
|
@ -236,8 +236,10 @@ if (! function_exists('bs_announcement')) {
|
||||
|
||||
if (! function_exists('bs_nickname')) {
|
||||
|
||||
function bs_nickname(\App\Models\User $user)
|
||||
function bs_nickname(\App\Models\User $user = null)
|
||||
{
|
||||
$user = $user ?: app('users')->getCurrentUser();
|
||||
|
||||
return ($user->getNickName() == '') ? $user->email : $user->getNickName();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user