去掉login_flag
This commit is contained in:
parent
a272be1686
commit
7e130ee89e
|
@ -37,15 +37,11 @@ class AccountController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
# Log out current user and redirect to welcome page
|
# Log out current user and redirect to welcome page
|
||||||
# cookies[:login_flag] 是为了配合毛xx
|
|
||||||
# 退出再登录的话直接跳转到用户首页而不是登陆前的页面
|
|
||||||
# 相应处理方法在application_helper#is_logout? :1106
|
|
||||||
def logout
|
def logout
|
||||||
if User.current.anonymous?
|
if User.current.anonymous?
|
||||||
redirect_to home_url
|
redirect_to home_url
|
||||||
elsif request.post?
|
elsif request.post?
|
||||||
logout_user
|
logout_user
|
||||||
cookies[:login_flag] = 1
|
|
||||||
redirect_to home_url
|
redirect_to home_url
|
||||||
end
|
end
|
||||||
# display the logout form
|
# display the logout form
|
||||||
|
|
|
@ -1103,14 +1103,6 @@ module ApplicationHelper
|
||||||
url
|
url
|
||||||
end
|
end
|
||||||
|
|
||||||
# 完成毛 功能
|
|
||||||
# 具体信息参考account_controller#logout
|
|
||||||
def is_logout?
|
|
||||||
ret = cookies[:login_flag] == 1 ? true : false
|
|
||||||
cookies.delete(:login_flag)
|
|
||||||
ret
|
|
||||||
end
|
|
||||||
|
|
||||||
def back_url_hidden_field_tag
|
def back_url_hidden_field_tag
|
||||||
url = back_url
|
url = back_url
|
||||||
hidden_field_tag('back_url', url, :id => nil) unless url.blank?
|
hidden_field_tag('back_url', url, :id => nil) unless url.blank?
|
||||||
|
|
Loading…
Reference in New Issue