This commit is contained in:
yuanke 2016-08-22 13:52:40 +08:00
parent 0412009182
commit 53bca5c006
1 changed files with 9 additions and 4 deletions

View File

@ -419,9 +419,12 @@ class WechatsController < ActionController::Base
logger.info "user_activities!!!!!!!!!!!!!!"
logger.info params
# unless (user_binded?(open_id) || params[:state] == "invite_code" || params[:state] == "project_invite_code" || params[:state] == "blog_comment" || params[:state] == "course_notice" || params[:state] == "project_discussion" || params[:state] == "course_discussion" || params[:state] == "homework" || params[:state] == "issues" || params[:state] == "journal_for_message")
# @path = '/login'
# else
unless (user_binded?(open_id) || params[:state] == "invite_code" || params[:state] == "project_invite_code" || params[:state] == "blog_comment" || params[:state] == "course_notice" || params[:state] == "project_discussion" || params[:state] == "course_discussion" || params[:state] == "homework" || params[:state] == "issues" || params[:state] == "journal_for_message")
if !(session["login"] != nil && session["login"] == false)
@path = '/login'
end
session["login"] = nil
else
if params[:state] == 'myclass'
@course_id = params[:id];
elsif params[:state] == 'myproject'
@ -430,6 +433,8 @@ class WechatsController < ActionController::Base
session[:wechat_openid] = open_id
if params[:code]
#不跳转至绑定界面的标志
session["login"] = false
if params[:userid]
redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}&userid=#{params[:userid]}" and return
elsif params[:id]
@ -439,7 +444,7 @@ class WechatsController < ActionController::Base
end
# redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return
end
# end
end
render 'wechats/user_activities', layout: nil
end