screemService = new ScreenService(); } public function live() { $id = $this->request->param("id"); if (empty($id)) { $this->error("非法请求"); } $this->auth->setMatchId($id); if (!$this->screemService->verifyScreen(['match_id' => $id, 'type' => "ranking"])) { // 判断是否登陆 if (!Session::has("screen_ranking{$id}")) { $this->match_id = $id; $this->error("请先登录!", url('live/login', ['match_id' => $id])); } } $screen_info = $this->screemService->getScreenInfo([ 'match_id' => $id, 'type' => "ranking" ]); $this->view->assign("match_id", $id); $this->view->assign('screeninfo', $screen_info); return $this->view->fetch(); } public function login() { if ($this->request->isPost()) { $data['look_pwd'] = $this->request->post("password"); if (empty($data['look_pwd'])) { $this->error("密码不能为空!"); } elseif (empty($this->request->param("match_id"))) { $this->error("非法请求"); } $data['match_id'] = $this->request->param("match_id"); $data['type'] = 'ranking'; if ($this->screemService->verifyScreen($data)) { Session::set("screen_ranking{$data['match_id']}", true); $this->success("登陆成功!", url('live/live?id='.$data['match_id'])); } else { $this->error("密码错误!"); } } $id = $this->request->param("match_id"); if (empty($id)) { $this->error("非法请求"); } return $this->view->fetch(); } }