From be95b3990df3dd7e4a9da114dac0ad7a66fe17af Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Mon, 22 Aug 2016 10:04:31 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 6ccfbcce1..2144e9c2c 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -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] - redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}&userid=#{params[:userid]}" and return + render "/wechat/user_activities##{@path}?id=#{params[:id]}&userid=#{params[:userid]}" and return elsif params[:id] - redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return + render "/wechat/user_activities##{@path}?id=#{params[:id]}" and return else - redirect_to "/wechat/user_activities##{@path}" and return + render "/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