不能删除root 账号
This commit is contained in:
parent
d7deeb62df
commit
4d2e9b3efd
|
|
@ -66,9 +66,13 @@ class CustomerRepo
|
|||
/**
|
||||
* @param $id
|
||||
* @return void
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function delete($id)
|
||||
{
|
||||
if ($id == 1) {
|
||||
throw new \Exception(trans('admin/customer.cannot_delete_root'));
|
||||
}
|
||||
Customer::query()->find($id)->delete();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,5 +14,7 @@ return [
|
|||
'customers_create' => 'Create',
|
||||
'customers_show' => 'Detail',
|
||||
'customers_update' => 'Edit',
|
||||
'customers_delete' => 'Delete'
|
||||
'customers_delete' => 'Delete',
|
||||
|
||||
'cannot_delete_root' => 'Cannot delete root admin user',
|
||||
];
|
||||
|
|
|
|||
|
|
@ -15,4 +15,6 @@ return [
|
|||
'customers_show' => '客户详情',
|
||||
'customers_update' => '更新客户',
|
||||
'customers_delete' => '删除客户',
|
||||
|
||||
'cannot_delete_root' => '不能删除Root账户',
|
||||
];
|
||||
|
|
|
|||
Loading…
Reference in New Issue