request->controller() . ucwords($this->request->action())); $lists = invoke($listName); } return JsonService::dataLists($lists); } /** * @notes 操作失败 * @param string $msg * @param array $data * @param int $code * @param int $show * @return \think\response\Json * @author 段誉 * @date 2021/12/27 14:21 */ protected function fail(string $msg = 'fail', array $data = [], int $code = 0, int $show = 1) { return JsonService::fail($msg, $data, $code, $show); } /** * @notes 是否免登录验证 * @return bool * @author 段誉 * @date 2021/12/27 14:21 */ public function isNotNeedLogin() : bool { $notNeedLogin = $this->notNeedLogin; if (empty($notNeedLogin)) { return false; } $action = $this->request->action(); if (!in_array(trim($action), $notNeedLogin)) { return false; } return true; } }