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