/** * Execute the job. */ public function handle(MenuService $menuService) { if (!$this->account) { $this->delete(); } $menuService->syncToLocal($this->account); $this->delete(); }
/** * 清除全部菜单. * * @return \Illuminate\Http\JsonResponse */ public function clear() { try { // 当前选中的公众号 $currentAccount = $this->accountService->chosedAccount(); $this->menuService->deleteAll($currentAccount); return success('清除成功'); } catch (\Exception $e) { return error('清除失败'); } }