From a1a58ee26c20a7cabf4e0403a4dcdf6bd70fb3dc Mon Sep 17 00:00:00 2001 From: yanxd Date: Wed, 2 Apr 2014 16:43:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/account_controller.rb | 3 +++ app/helpers/application_helper.rb | 2 ++ 2 files changed, 5 insertions(+) diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index d77392cdf..f10e84cc0 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -37,6 +37,9 @@ class AccountController < ApplicationController end # Log out current user and redirect to welcome page + # cookies[:login_flag] 是为了配合毛xx + # 退出再登录的话直接跳转到用户首页而不是登陆前的页面 + # 相应处理方法在application_helper#is_logout? :1106 def logout if User.current.anonymous? redirect_to home_url diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index fdb77098c..6047fcf2b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1103,6 +1103,8 @@ module ApplicationHelper url end + # 完成毛 功能 + # 具体信息参考account_controller#logout def is_logout? ret = cookies[:login_flag] == 1 ? true : false cookies.delete(:login_flag)