info()) { $this->save->un(self::NAME); } $refer = isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] ? $_SERVER['HTTP_REFERER'] : Dever::url('home', 'main'); Dever::location($refer); } public function action() { $account = Dever::config('base', 'project')->account; $param['option_' . $account] = Dever::input($account); $password = sha1(Dever::input('password')); $user = Dever::load('passport/user-login', $param); if ($user && $password == $user['password']) { $this->save($user); $this->refer(); } else { Dever::alert('您的账号或密码错误'); } } public function check() { if ($this->info()) { $url = $this->refer(true); return Dever::location($url); } } public function get() { return $this->info(); } public function url() { return Dever::url('login?' . $this->createRefer(), 'main'); } public function location() { return Dever::location($this->url()); } public function oauth($url = false) { if (!$url) { $url = Dever::url(); } $link = Dever::url('get.request?refer=' . urlencode($url), 'oauth'); return $link; } }