From 084b545be97c9d436a1be66107791eda31535c1b Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 24 Jun 2016 17:14:58 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BA=E6=AD=A3?= =?UTF-8?q?=E5=BC=8F=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/wechats_controller.rb | 2 +- config/wechat.yml | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 2afb85ace..912d92c70 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -4,7 +4,7 @@ class WechatsController < ActionController::Base include ApplicationHelper # ROOT_URL = "#{Setting.protocol}://#{Setting.host_name}/" - ROOT_URL = "http://wechat.trustie.net" + ROOT_URL = "http://www.trustie.net" # default text responder when no other match on :text do |request, content| #邀请码 diff --git a/config/wechat.yml b/config/wechat.yml index 711f2f1f8..1e3389837 100644 --- a/config/wechat.yml +++ b/config/wechat.yml @@ -5,14 +5,14 @@ default: &default # Or if using public account, only need above two line # guange test - appid: "wxf694495398c7d470" - secret: "743e038392f1d89540e95f8f7645849a" + #appid: "wxf694495398c7d470" + #secret: "743e038392f1d89540e95f8f7645849a" -# appid: "wx8e1ab05163a28e37" -# secret: "beb4d3bc4b32b3557811680835357841" + appid: "wx8e1ab05163a28e37" + secret: "beb4d3bc4b32b3557811680835357841" token: "123456" - access_token: "1234567" + access_token: ".access_token" encrypt_mode: false # if true must fill encoding_aes_key encoding_aes_key: "QGfP13YP4BbQGkkrlYuxpn4ZIDXpBJww4fxl8CObvNw" jsapi_ticket: "C:/Users/[user_name]/wechat_jsapi_ticket" @@ -30,4 +30,4 @@ development: <<: *default test: - <<: *default \ No newline at end of file + <<: *default From f1682edf64e12247c0120dd7ce35fe7ceea7de0b Mon Sep 17 00:00:00 2001 From: yuanke <249218296@qq.com> Date: Fri, 24 Jun 2016 17:18:04 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E8=B4=B4=E5=90=A7BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/forums/create.js.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/forums/create.js.erb b/app/views/forums/create.js.erb index bea3f3872..ee8172cbd 100644 --- a/app/views/forums/create.js.erb +++ b/app/views/forums/create.js.erb @@ -1,7 +1,7 @@ <%if @save_flag%> //$('#new_forum_div').slideToggle();$('#create_btn').parent().slideToggle(); //$('#reorder_time').click(); - window.location.href= "http://"+"<%= Setting.host_name%>"+"/forums/" + "<%= @forum.id%>" + window.location.href= "<%= host_with_protocol %>"+"/forums/" + "<%= @forum.id%>" <%else%> $("#error").html("<%= @forum.errors.full_messages[0]%>").show(); <%end %> From b5bfe40693f161790151b7f5994310a5e99ad70c Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 24 Jun 2016 17:35:55 +0800 Subject: [PATCH 3/3] . --- app/api/mobile/apis/courses.rb | 2 +- app/controllers/wechats_controller.rb | 3 +++ config/menu.yml | 16 ++++------------ 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/app/api/mobile/apis/courses.rb b/app/api/mobile/apis/courses.rb index 58d4a4f8c..6696b8360 100644 --- a/app/api/mobile/apis/courses.rb +++ b/app/api/mobile/apis/courses.rb @@ -103,7 +103,7 @@ module Mobile post "join" do authenticate! cs = CoursesService.new - status = cs.join_course({openid: params[:openid], invite_code: params[:invite_code]}, current_user) + status = cs.join_course({role: "10", openid: params[:openid], invite_code: params[:invite_code]}, current_user) { status: status[:state], messsge:CoursesService::JoinCourseError.message(status[:state]) diff --git a/app/controllers/wechats_controller.rb b/app/controllers/wechats_controller.rb index 912d92c70..7dcfa1948 100644 --- a/app/controllers/wechats_controller.rb +++ b/app/controllers/wechats_controller.rb @@ -64,6 +64,9 @@ class WechatsController < ActionController::Base request.reply.text "User: #{request[:FromUserName]} click #{key}" end + on :click, with: 'DEV' do |request, key| + request.reply.text "此功能正在开发中,请耐心等待。" + end # When user view URL in the menu button on :view, with: 'http://wechat.somewhere.com/view_url' do |request, view| request.reply.text "#{request[:FromUserName]} view #{view}" diff --git a/config/menu.yml b/config/menu.yml index c2579d8e6..735cd202f 100644 --- a/config/menu.yml +++ b/config/menu.yml @@ -7,13 +7,13 @@ button: name: "我的课程" sub_button: - - type: "view" + type: "click" name: "课程" - url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf694495398c7d470&redirect_uri=http://wechat.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect" + key: "DEV" - - type: "view" + type: "click" name: "资源" - url: "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxf694495398c7d470&redirect_uri=http://wechat.trustie.net/wechat/user_activities&response_type=code&scope=snsapi_base&state=123#wechat_redirect" + key: "DEV" - name: "更多" @@ -22,14 +22,6 @@ button: type: "view" name: "加入班级" url: "https://www.trustie.net/" - - - type: "view" - name: "点名" - url: "https://www.trustie.net/organizations/1/downloads" - - - type: "click" - name: "反馈" - key: "FEEDBACK" - type: "view" name: "历史推文"