clear icon cache after modify

This commit is contained in:
xiaomlove
2023-02-06 14:25:05 +08:00
parent 23ea393ffe
commit 59b7a2916e
12 changed files with 35 additions and 13 deletions

View File

@@ -18,4 +18,9 @@ class CreateIcon extends CreateRecord
'desc' => nexus_trans('label.icon.desc')
];
}
public function afterCreate()
{
clear_icon_cache();
}
}

View File

@@ -28,4 +28,9 @@ class EditIcon extends EditRecord
'desc' => nexus_trans('label.icon.desc')
];
}
public function afterSave()
{
clear_icon_cache();
}
}

View File

@@ -43,7 +43,7 @@ class Kernel extends HttpKernel
'api' => [
'throttle:api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\App\Http\Middleware\Platform::class,
// \App\Http\Middleware\Platform::class,
],
'filament' => [
\Illuminate\Session\Middleware\StartSession::class,

View File

@@ -17,7 +17,7 @@ class SecondIcon extends NexusModel
foreach (SearchBox::$taxonomies as $torrentField => $taxonomyTableModel) {
$mode = $data['mode'];
if ($mode === null || empty($data[$torrentField][$mode])) {
unset($data[$torrentField]);
$data[$torrentField] = 0;
} else {
$data[$torrentField] = $data[$torrentField][$mode];
}

View File

@@ -17,9 +17,9 @@ class AuthenticateRepository extends BaseRepository
if (!$user || md5($user->secret . $password . $user->secret) != $user->passhash) {
throw new \InvalidArgumentException('Username or password invalid.');
}
if (nexus()->isPlatformAdmin() && !$user->canAccessAdmin()) {
throw new UnauthorizedException('Unauthorized!');
}
// if (nexus()->isPlatformAdmin() && !$user->canAccessAdmin()) {
// throw new UnauthorizedException('Unauthorized!');
// }
$user->checkIsNormal();
$tokenName = __METHOD__ . __LINE__;
$token = DB::transaction(function () use ($user, $tokenName) {