Merge branch 'weixin_guange' into develop
This commit is contained in:
commit
68b0ac39ee
|
@ -37,7 +37,7 @@ module Mobile
|
||||||
|
|
||||||
raise "此用户已经绑定过公众号, 请换一个帐户试试" if user.user_wechat
|
raise "此用户已经绑定过公众号, 请换一个帐户试试" if user.user_wechat
|
||||||
|
|
||||||
if uw && !user.real?
|
if uw && !uw.real?
|
||||||
uw.migrate_user(user)
|
uw.migrate_user(user)
|
||||||
else
|
else
|
||||||
UserWechat.create!(
|
UserWechat.create!(
|
||||||
|
@ -69,7 +69,7 @@ module Mobile
|
||||||
:should_confirmation_password => true)
|
:should_confirmation_password => true)
|
||||||
raise user.errors.full_messages.first if user.new_record?
|
raise user.errors.full_messages.first if user.new_record?
|
||||||
|
|
||||||
if uw && !user.real?
|
if uw && !uw.real?
|
||||||
user.update_attributes(:lastname=>uw.user[:lastname])
|
user.update_attributes(:lastname=>uw.user[:lastname])
|
||||||
uw.migrate_user(user)
|
uw.migrate_user(user)
|
||||||
else
|
else
|
||||||
|
|
|
@ -252,13 +252,16 @@ class WechatsController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def sendBind(request)
|
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创新实践服务平台!
|
news = (1..1).each_with_object([]) { |n, memo| memo << { title: '绑定登录', content: "欢迎使用Trustie创新实践服务平台!
|
||||||
在这里您可以随时了解您的课程和项目动态,随时点赞和回复。
|
在这里您可以随时了解您的课程和项目动态,随时点赞和回复。
|
||||||
我们将会与微信不断结合,为您提供更有价值的服务。
|
我们将会与微信不断结合,为您提供更有价值的服务。
|
||||||
|
|
||||||
您还未绑定确实的用户,请先绑定,谢谢!" } }
|
您还未绑定确实的用户,请先绑定,谢谢!" } }
|
||||||
request.reply.news(news) do |article, n, index| # article is return object
|
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"
|
url = tmpurl
|
||||||
pic_url = "#{ROOT_URL}/images/weixin_pic.jpg"
|
pic_url = "#{ROOT_URL}/images/weixin_pic.jpg"
|
||||||
article.item title: "#{n[:title]}",
|
article.item title: "#{n[:title]}",
|
||||||
description: n[:content],
|
description: n[:content],
|
||||||
|
|
|
@ -17,7 +17,7 @@ class UserWechat < ActiveRecord::Base
|
||||||
## 主要是将comment 迁移
|
## 主要是将comment 迁移
|
||||||
User.delete(old_user)
|
User.delete(old_user)
|
||||||
|
|
||||||
JournalForMessages.where(user_id: old_user).update_all(user_id: u.id)
|
JournalsForMessage.where(user_id: old_user).update_all(user_id: u.id)
|
||||||
Journal.where(user_id: old_user).update_all(user_id: u.id)
|
Journal.where(user_id: old_user).update_all(user_id: u.id)
|
||||||
Comment.where(author_id: old_user).update_all(author_id: u.id)
|
Comment.where(author_id: old_user).update_all(author_id: u.id)
|
||||||
Message.where(author_id: old_user).update_all(author_id: u.id)
|
Message.where(author_id: old_user).update_all(author_id: u.id)
|
||||||
|
|
Loading…
Reference in New Issue