screenService = new ScreenService(); } public function getScreenList() { // 解决跨域请求接口问题 header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Credentials: true'); // 设置是否允许发送 cookies header('Access-Control-Expose-Headers: *'); //服务器 headers 白名单,可以让客户端进行访问 header('Access-Control-Allow-Headers: *'); $match_id = $this->request->param('match_id'); if (empty($match_id)) { $this->error("赛事id不可为空!"); } $this->screenService->match_id = $match_id; $screenList = $this->screenService->screenList($match_id); if (!empty($screenList)) { $res['code'] = 1; $res['data'] = $screenList; $res['msg'] = "获取成功"; } else { $res['code'] = 0; $res['data'] = []; $res['msg'] = "数据为空"; } return json($res); } public function verify_password() { $param['look_pwd'] = $this->request->param("password", "123456"); $param['match_id'] = $this->request->param("match_id", 0); $res = $this->screenService->verifyScreen($param); if ($res) { $res['code'] = 1; $res['data'] = []; $res['msg'] = "验证成功"; } else { $res['code'] = 0; $res['data'] = []; $res['msg'] = "验证失败"; } return json($res); } }