修改 删除逻辑

This commit is contained in:
iVampireSP.com 2022-09-09 17:20:47 +08:00
parent 693f9ab3ea
commit 3e9f23fe65
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -44,6 +44,11 @@ public function update(Request $request, Host $host)
public function destroy(Host $host) public function destroy(Host $host)
{ {
if ($host->user_id == auth()->id()) { if ($host->user_id == auth()->id()) {
if ($host->status == 'pending') {
return $this->error('主机正在创建中,无法删除');
}
dispatch(new \App\Jobs\Remote\Host($host, 'delete')); dispatch(new \App\Jobs\Remote\Host($host, 'delete'));
} else { } else {
return $this->error('无权操作'); return $this->error('无权操作');