diff --git a/app/api/mobile/apis/new_comment.rb b/app/api/mobile/apis/new_comment.rb index 8339e9ec0..09ec28d89 100644 --- a/app/api/mobile/apis/new_comment.rb +++ b/app/api/mobile/apis/new_comment.rb @@ -11,10 +11,8 @@ module Mobile params do requires :type, type: String requires :content, type: String - requires :token, type: String end post ':id' do - # authenticate! unless current_user #如果当前用户不存在 则需要根据微信昵称注册一个帐号 openid = session[:wechat_openid] @@ -38,6 +36,8 @@ module Mobile ) end + authenticate! + status = 0 tip = 0 #0班级1项目 type = params[:type] diff --git a/app/views/wechats/user_activities.html.erb b/app/views/wechats/user_activities.html.erb index eb58fbe3e..7175f0a1e 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 = "https://"+"<%= Setting.host_name%>"; + window.g_localhost = "<%= Setting.protocol %>"+ "://"+"<%= Setting.host_name%>"; window.g_appid = "<%= @appid %>"; <% if @course_id %> window.g_courseid = <%= @course_id %>;