Merge remote-tracking branch 'origin/develop' into guange_dev

This commit is contained in:
guange 2016-04-25 21:22:28 +08:00
commit 98f84bb0ab
2 changed files with 15 additions and 15 deletions

View File

@ -1 +1 @@
{"access_token":"GrEg56Sg5QRM7IXghWlaDzNd-7iaQsqX2acszXkSTFwOh_OxtN_UNIJsj9rlSZeSkZSofQwd0KvFGv_StzARHeLw81JllcI3a3VuXgZ_cjbQnM3m00g0HiLtTniQFsEIUVIdABAPQD","expires_in":7200,"got_token_at":1461314104}
{"access_token":"GrEg56Sg5QRM7IXghWlaDzNd-7iaQsqX2acszXkSTFwOh_OxtN_UNIJsj9rlSZeSkZSofQwd0KvFGv_StzARHeLw81JllcI3a3VuXgZ_cjbQnM3m00g0HiLtTniQFsEIUVIdABAPQD","expires_in":7200,"got_token_at":1461314104}

View File

@ -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"
}
}
}