/** * 登录 */ public function login() { view::remove('menu'); $name = $this->post('user'); $pass = $this->post('pass'); if (!$name || !$pass) { return; } $user = muser::get($name); if (!$user) { view::assign('tips', USER_NOT_EXISTS); return; } if (md5(sha1($name . KEY . $pass)) !== $user['pass']) { view::assign('tips', PASSWORD_INCORRECT); return; } redirect('?action=admin.index'); }