改进 删除处理

This commit is contained in:
iVampireSP.com 2023-02-13 02:54:55 +08:00
parent 308ed248f6
commit a4b9254433
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -50,8 +50,12 @@ public function renew(Host $host)
*/ */
public function destroy(Host $host): RedirectResponse public function destroy(Host $host): RedirectResponse
{ {
if ($host->status === 'unavailable') {
return back()->with('error', '为了安全起见,此主机只能由我们自动删除。');
}
$host->safeDelete(); $host->safeDelete();
return redirect()->route('hosts . index')->with('success', '已添加到删除队列。'); return redirect()->route('hosts.index')->with('success', '已添加到删除队列。');
} }
} }