From 7fe3f9fe716aa3509ccf2eac9a65eb1252a1ca76 Mon Sep 17 00:00:00 2001
From: yuanke <249218296@qq.com>
Date: Fri, 15 Jul 2016 20:30:50 +0800
Subject: [PATCH 01/76] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=94=B9=E4=B8=BA?=
=?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=89=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
config/wechat.yml | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/config/wechat.yml b/config/wechat.yml
index d839f1606..6b3799706 100644
--- a/config/wechat.yml
+++ b/config/wechat.yml
@@ -20,26 +20,26 @@ default: &default
encrypt_mode: false # if true must fill encoding_aes_key
#production
- encoding_aes_key: "QGfP13YP4BbQGkkrlYuxpn4ZIDXpBJww4fxl8CObvNw"
- jsapi_ticket: "C:/Users/[user_name]/wechat_jsapi_ticket"
-
- #template
- binding_succ_notice: "jjpDrgFErnmkrE9tf2M3o0t31ZrJ7mr0YtuE_wyLaMc"
- journal_notice: "uC1zAw4F2q6HTA3Pcj8VUO6wKKKiYFwnPJB4iXxpdoM"
- homework_message_notice: "tCf7teCVqc2vl2LZ_hppIdWmpg8yLcrI8XifxYePjps"
- class_notice: "MQ_mFupbXP-9jWbeHT3C5xqNBvPo8EIlNv4ULakSpJA"
- create_class_notice: "2GtJJGzzNlNy2i0UrsjEDlvfSVIUXQfSo47stpcQAVw"
-
- #test
-# encoding_aes_key: "QyocNOkRmrT5HzBpCG54EVPUQjk86nJapXNVDQm6Yy6"
+# encoding_aes_key: "QGfP13YP4BbQGkkrlYuxpn4ZIDXpBJww4fxl8CObvNw"
# jsapi_ticket: "C:/Users/[user_name]/wechat_jsapi_ticket"
#
# #template
-# binding_succ_notice: "n4KLwcWNrIMYkKxWL2hUwzunm5RTT54EbWem2MIUapU"
-# journal_notice: "XpHHYkqSGkwuF9vHthRdmPQLvCFRQ4_NbRBP12T7ciE"
-# homework_message_notice: "Kom0TsYYKsNKCS6luweYVRo9z-mH0wRPr24b1clGCPQ"
-# class_notice: "8LVu33l6bP-56SDomVgHn-yJc57YpCwwJ81rAJgRONk"
-# create_class_notice: "9CDIvHIKiGwPEQWRw_-wieec1o50tMXQPPZIfECKu0I"
+# binding_succ_notice: "jjpDrgFErnmkrE9tf2M3o0t31ZrJ7mr0YtuE_wyLaMc"
+# journal_notice: "uC1zAw4F2q6HTA3Pcj8VUO6wKKKiYFwnPJB4iXxpdoM"
+# homework_message_notice: "tCf7teCVqc2vl2LZ_hppIdWmpg8yLcrI8XifxYePjps"
+# class_notice: "MQ_mFupbXP-9jWbeHT3C5xqNBvPo8EIlNv4ULakSpJA"
+# create_class_notice: "2GtJJGzzNlNy2i0UrsjEDlvfSVIUXQfSo47stpcQAVw"
+
+ #test
+ encoding_aes_key: "QyocNOkRmrT5HzBpCG54EVPUQjk86nJapXNVDQm6Yy6"
+ jsapi_ticket: "C:/Users/[user_name]/wechat_jsapi_ticket"
+
+ #template
+ binding_succ_notice: "n4KLwcWNrIMYkKxWL2hUwzunm5RTT54EbWem2MIUapU"
+ journal_notice: "XpHHYkqSGkwuF9vHthRdmPQLvCFRQ4_NbRBP12T7ciE"
+ homework_message_notice: "Kom0TsYYKsNKCS6luweYVRo9z-mH0wRPr24b1clGCPQ"
+ class_notice: "8LVu33l6bP-56SDomVgHn-yJc57YpCwwJ81rAJgRONk"
+ create_class_notice: "9CDIvHIKiGwPEQWRw_-wieec1o50tMXQPPZIfECKu0I"
production:
<<: *default
From 51692eadd619f6ffbd5ebab9890916c425134806 Mon Sep 17 00:00:00 2001
From: guange <8863824@gmail.com>
Date: Sun, 17 Jul 2016 00:49:35 +0800
Subject: [PATCH 02/76] =?UTF-8?q?=E6=94=B9=E8=BF=9B=E4=B8=8A=E7=BA=BF?=
=?UTF-8?q?=E6=B5=81=E7=A8=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/wechats_helper.rb | 20 +++++++++
app/views/wechats/user_activities.html.erb | 28 +-----------
config/application.rb | 5 ++-
lib/tasks/wechat.rake | 31 +++++++++++++
public/javascripts/wechat/build/app.min.js | 51 ++++++++++++++++------
5 files changed, 95 insertions(+), 40 deletions(-)
create mode 100644 app/helpers/wechats_helper.rb
create mode 100644 lib/tasks/wechat.rake
diff --git a/app/helpers/wechats_helper.rb b/app/helpers/wechats_helper.rb
new file mode 100644
index 000000000..5c6b3da8c
--- /dev/null
+++ b/app/helpers/wechats_helper.rb
@@ -0,0 +1,20 @@
+#coding=utf-8
+#
+
+module WechatsHelper
+ def include_wechat_jsfile
+ if Rails.env.production?
+ javascript_include_tag '/javascripts/wechat/build/app.min.js'
+ else
+ wechat_path = File.join(Rails.root, "public", "javascripts", "wechat")
+ srcs = Rails.application.config.wechat_srcs
+ paths = []
+ srcs.each do |src|
+ Dir.glob(wechat_path+ "/#{src}" ) do |path|
+ paths << path[File.join(Rails.root, "public").to_s.size, path.size]
+ end
+ end
+ javascript_include_tag *paths
+ end
+ end
+end
diff --git a/app/views/wechats/user_activities.html.erb b/app/views/wechats/user_activities.html.erb
index 6c3da9cf4..d21449648 100644
--- a/app/views/wechats/user_activities.html.erb
+++ b/app/views/wechats/user_activities.html.erb
@@ -10,7 +10,7 @@
-
+ <%= stylesheet_link_tag '/stylesheets/weui/weixin.css' %>
-->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+<%= include_wechat_jsfile %>