From 9a6ea9757da27a5831241b3a6b6c8fae141bffd2 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 25 Apr 2016 11:12:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=A8=A1=E6=9D=BF=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E7=9A=84=E9=A2=9C=E8=89=B2=E3=80=81=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=B6=88=E6=81=AF=E7=9A=84=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E4=B8=80=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1234567 | 2 +- app/services/wechat_service.rb | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/1234567 b/1234567 index 327c92785..dc8696854 100644 --- a/1234567 +++ b/1234567 @@ -1 +1 @@ -{"access_token":"x7GUTe-MLoVPMzId82-3VSdCsO6sq5cOJZCmIN-yUjDcohfI00t2lzPkNKdRhETLUBptZRQ--v-IBQTG-o5iRZZv-EelOBX7K96DcPMFt9rdzwNu7XerNnZw_ncGYncSLHXeACAQMC","expires_in":7200,"got_token_at":1461133885} \ No newline at end of file +{"access_token":"03kBJXYaoncSoMkMC_GyNNhKmx6rzK3DbzN0_VxgOJO9_Xtp2F5pSYw0X2HdTWg5sUf0zw3oY1O8ZPVF3TbLGwYP5-kj9AlpS4F2fqEY03BE95y5hPRlVv3g_VegHP25VINhAJAIVA","expires_in":7200,"got_token_at":1461306222} \ No newline at end of file diff --git a/app/services/wechat_service.rb b/app/services/wechat_service.rb index 2fb222d4f..ee999d98f 100644 --- a/app/services/wechat_service.rb +++ b/app/services/wechat_service.rb @@ -1,7 +1,7 @@ #encoding: utf-8 class WechatService - def template_data(openid, template_id, type, id, first, key1, key2, key3, remark="具体内容请点击详情查看网站") + def template_data(openid, template_id, type, id, first, key1, key2, key3, remark="") data = { touser:openid, template_id:template_id, @@ -10,30 +10,30 @@ class WechatService data:{ first: { value:first, - color:"#173177" + color:"#CCCCCC" }, keyword1:{ value:key1, - color:"#173177" + color:"#CCCCCC" }, keyword2:{ value:key2, - color:"#173177" + color:"#CCCCCC" }, keyword3:{ value:key3, - color:"#173177" + color:"#CCCCCC" }, remark:{ value:remark, - color:"#173177" + color:"#CCCCCC" } } } data end - def homework_template(user_id, type, id, first, key1, key2, key3, remark="具体内容请点击详情查看网站") + def homework_template(user_id, type, id, first, key1, key2, key3, remark="") uw = UserWechat.where(user_id: user_id).first unless uw.nil? data = template_data uw.openid,"3e5Dj2GIx8MOcMyRKpTUEQnM7Tg0ASSCNc01NS9HCGI", type, id, first, key1, key2, key3, remark @@ -47,7 +47,7 @@ class WechatService Rails.logger.info "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect" end - def topic_publish_template(user_id, type, id, first, key1, key2, key3, remark="具体内容请点击详情查看网站") + def topic_publish_template(user_id, type, id, first, key1, key2, key3, remark="") uw = UserWechat.where(user_id: user_id).first unless uw.nil? data = template_data uw.openid,"oKzFCdk7bsIHnGbscA__N8LPQrBkUShvpjV3-kuwWDQ", type, id,first, key1, key2, key3, remark @@ -62,7 +62,7 @@ class WechatService Rails.logger.info "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect" end - def comment_template(user_id,type, id, first, key1, key2, key3, remark="具体内容请点击详情查看网站") + def comment_template(user_id,type, id, first, key1, key2, key3, remark="") uw = UserWechat.where(user_id: user_id).first unless uw.nil? data = template_data uw.openid,"A_3f5v90-zK73V9Kijm-paDkl9S-NuM8Cf-1UJi92_c",type, id,first, key1, key2, key3, remark @@ -77,7 +77,7 @@ class WechatService Rails.logger.info "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxc09454f171153c2d&redirect_uri=https://www.trustie.net/assets/wechat/app.html#/#{type}/#{id}?response_type=code&scope=snsapi_base&state=123#wechat_redirect" end - def message_update_template(user_id, type, id, first, key1, key2, remark="具体内容请点击详情查看网站") + def message_update_template(user_id, type, id, first, key1, key2, remark="") uw = UserWechat.where(user_id: user_id).first unless uw.nil? data = { @@ -88,19 +88,19 @@ class WechatService data:{ first: { value:first, - color:"#173177" + color:"#CCCCCC" }, keyword1:{ value:key1, - color:"#173177" + color:"#CCCCCC" }, keyword2:{ value:key2, - color:"#173177" + color:"#CCCCCC" }, remark:{ value:remark, - color:"#173177" + color:"#CCCCCC" } } }