有多个账户时,退出再重新登录其它账户,登录进来却始终显示的是上一个账户的信息

This commit is contained in:
daiao 2017-01-18 14:41:01 +08:00
parent a41b9d3a42
commit e7e5f5d586
1 changed files with 1 additions and 1 deletions

View File

@ -583,7 +583,7 @@ class ApplicationController < ActionController::Base
uri = URI.parse(back_url)
# do not redirect user to another host or to the login or register page
if (uri.relative? || (uri.host == request.host)) && !uri.path.match(%r{/(login|account/register)})
back_url = back_url.gsub(%r{\/users\/(\d+)},"/users/"+default.id.to_s) if default.is_a?(User)
back_url = back_url.gsub(%r{\/users\/(\D+)},"/users/"+default.to_s) if default.is_a?(User)
redirect_to(back_url)
return
end