From 24a0bfea773f269d1a1680a86cc8d5c437123a23 Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 12 Aug 2016 12:05:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E4=BA=AB=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 16 ++++++++-------- app/views/wechats/user_activities.html.erb | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 69636c411..653184844 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -424,14 +424,14 @@ 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 - # elsif params[:id] - # redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return - # else - # redirect_to "/wechat/user_activities##{@path}" and return - # end - redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return + if params[:userid] + redirect_to "/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 + else + redirect_to "/wechat/user_activities##{@path}" and return + end + # redirect_to "/wechat/user_activities##{@path}?id=#{params[:id]}" and return end # end render 'wechats/user_activities', layout: nil diff --git a/app/views/wechats/user_activities.html.erb b/app/views/wechats/user_activities.html.erb index 413bf6852..eb58fbe3e 100644 --- a/app/views/wechats/user_activities.html.erb +++ b/app/views/wechats/user_activities.html.erb @@ -17,7 +17,7 @@ window.g_debug = false; //调试标志,如果在本地请置为true window.apiUrl = '/api/v1/'; window.g_redirect_path = '<%= @path %>'; - window.g_localhost = "<%= Setting.protocol%>://"+"<%= Setting.host_name%>"; + window.g_localhost = "https://"+"<%= Setting.host_name%>"; window.g_appid = "<%= @appid %>"; <% if @course_id %> window.g_courseid = <%= @course_id %>;