request->isAjax()) { return View::fetch(); } $model = new AppletModel; if ($url = $model->login($this->postData('data'))) { return $this->renderSuccess('登录成功', $url); } $error = $model->getError() ?: '登录失败'; return $this->renderError($error); } /** * 小程序管理端 - 退出登录 */ public function applet($app_type) { // 清空登录状态 Session::delete('hema_store_' . $app_type); return redirect(url('passport/login')); } /** * 其他管理端 - 退出登录 */ public function logout($app_type) { // 清空登录状态 Session::delete('hema_store_' . $app_type); return redirect(url($app_type . '.passport/login')); } }