This commit is contained in:
parent
f791f37205
commit
8129e29d5b
|
@ -3,18 +3,18 @@ class WechatsController < ActionController::Base
|
|||
wechat_responder
|
||||
|
||||
include ApplicationHelper
|
||||
|
||||
# ROOT_URL = "#{Setting.protocol}://#{Setting.host_name}/"
|
||||
ROOT_URL = "http://wechat.trustie.net"
|
||||
# default text responder when no other match
|
||||
on :text do |request, content|
|
||||
#邀请码
|
||||
if join_class(content)
|
||||
root_url = "http://wechat.trustie.net"
|
||||
|
||||
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '恭喜您成功加入班级,开始学习吧!',
|
||||
content: "课程名称: 数据结构\n班级名称: 数据结构A班\n任课老师: 尹刚\n进入班级,和小伙伴愉快的学习吧!"} }
|
||||
request.reply.news(news) do |article, n, index| # article is return object
|
||||
url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{root_url+'/wechat/user_activities'}&response_type=code&scope=snsapi_base&state=myclass#wechat_redirect"
|
||||
pic_url = "#{Setting.protocol}://#{Setting.host_name}/images/wechat/class.jpg"
|
||||
url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{ROOT_URL+'/wechat/user_activities'}&response_type=code&scope=snsapi_base&state=myclass#wechat_redirect"
|
||||
pic_url = "#{ROOT_URL}/images/wechat/class.jpg"
|
||||
article.item title: "#{n[:title]}",
|
||||
description: n[:content],
|
||||
pic_url: pic_url,
|
||||
|
@ -164,16 +164,14 @@ class WechatsController < ActionController::Base
|
|||
end
|
||||
|
||||
def sendBind(request)
|
||||
root_url = "http://wechat.trustie.net"
|
||||
|
||||
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '绑定登录', content: "欢迎使用Trustie创新实践服务平台!
|
||||
在这里您可以随时了解您的课程和项目动态,随时点赞和回复。
|
||||
我们将会与微信不断结合,为您提供更有价值的服务。
|
||||
|
||||
您还未绑定确实的用户,请先绑定,谢谢!" } }
|
||||
request.reply.news(news) do |article, n, index| # article is return object
|
||||
url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{root_url+'/wechat/user_activities'}&response_type=code&scope=snsapi_base&state=login#wechat_redirect"
|
||||
pic_url = "#{Setting.protocol}://#{Setting.host_name}/images/weixin_pic.jpg"
|
||||
url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=#{Wechat.config.appid}&redirect_uri=#{ROOT_URL+'/wechat/user_activities'}&response_type=code&scope=snsapi_base&state=login#wechat_redirect"
|
||||
pic_url = "#{ROOT_URL}/images/weixin_pic.jpg"
|
||||
article.item title: "#{n[:title]}",
|
||||
description: n[:content],
|
||||
pic_url: pic_url,
|
||||
|
|
Loading…
Reference in New Issue