微信关注提示语优化
This commit is contained in:
parent
6c37645c9e
commit
dcfb9d589e
|
@ -107,6 +107,7 @@ class WechatsController < ActionController::Base
|
|||
end
|
||||
|
||||
on :event, with: 'unsubscribe' do |request|
|
||||
unBind(request)
|
||||
request.reply.success # user can not receive this message
|
||||
end
|
||||
|
||||
|
@ -274,12 +275,17 @@ class WechatsController < ActionController::Base
|
|||
end
|
||||
end
|
||||
|
||||
def unBind(request)
|
||||
uw = user_binded?(request[:FromUserName])
|
||||
uw.try(:subscribe!)
|
||||
end
|
||||
|
||||
def sendBind(request)
|
||||
tmpurl = "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&connect_redirect=1#wechat_redirect"
|
||||
logger.info "tmpurl!!!!!!!!!!!!!!"
|
||||
logger.info tmpurl
|
||||
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '绑定登录', content: "欢迎使用Trustie创新实践服务平台!
|
||||
在这里您可以随时了解您的课程和项目动态,随时点赞和回复。
|
||||
在这里您可以随时了解您的课程和项目动态,随时点赞和回复。交作业、代码提交等更多功能,请前往 www.trustie.net
|
||||
我们将会与微信不断结合,为您提供更有价值的服务。
|
||||
|
||||
您还未绑定确实的用户,请先绑定,谢谢!" } }
|
||||
|
|
|
@ -24,4 +24,9 @@ class UserWechat < ActiveRecord::Base
|
|||
BlogComment.where(author_id: old_user).update_all(author_id: u.id)
|
||||
UserActivity.where(user_id: old_user).update_all(user_id: u.id)
|
||||
end
|
||||
|
||||
|
||||
def unsubscribe!
|
||||
self.delete
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue