This commit is contained in:
yuanke 2016-08-22 11:13:14 +08:00
parent a38d4f15a6
commit 0412009182
1 changed files with 7 additions and 7 deletions

View File

@ -419,9 +419,9 @@ 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")
# @path = '/login'
# else
if params[:state] == 'myclass'
@course_id = params[:id];
elsif params[:state] == 'myproject'
@ -431,15 +431,15 @@ class WechatsController < ActionController::Base
session[:wechat_openid] = open_id
if params[:code]
if params[:userid]
render "/wechat/user_activities##{@path}?id=#{params[:id]}&userid=#{params[:userid]}",layout: nil and return
redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}&userid=#{params[:userid]}" and return
elsif params[:id]
render "/wechat/user_activities##{@path}?id=#{params[:id]}",layout: nil and return
redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return
else
render "/wechat/user_activities##{@path}",layout: nil and return
redirect_to "/wechat/user_activities##{@path}" and return
end
# redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return
end
end
# end
render 'wechats/user_activities', layout: nil
end