[''], 'allow' => ['quickedit'] ]; Hook::listen('check_auth',$action); $request = Request::instance(); $a = strtolower($request->action()); if (!in_array($a, $action['permission'])) { parent::_initialize(); } } /** * 快捷编辑 * * @param CommonLogic $commonLogic * @return \think\response\Json * @throws \think\Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException * @throws \think\exception\PDOException */ public function quickEdit(CommonLogic $commonLogic) { if (empty($this->param['types'])) return resultArray(['error' => '缺少模块类型!']); if (empty($this->param['action_id'])) return resultArray(['error' => '缺少数据ID!']); if ($commonLogic->quickEdit($this->param) === false) return resultArray(['error' => $commonLogic->error]); return resultArray(['data' => '操作成功!']); } }