|
|
@ -27,8 +27,7 @@ module Mobile
|
|
|
|
post 'wxbind' do
|
|
|
|
post 'wxbind' do
|
|
|
|
openid = session[:wechat_openid]
|
|
|
|
openid = session[:wechat_openid]
|
|
|
|
logger.debug "openid ============== #{openid}"
|
|
|
|
logger.debug "openid ============== #{openid}"
|
|
|
|
# raise "无法获取到openid,请在微信中打开本页面" unless openid
|
|
|
|
raise "无法获取到openid,请在微信中打开本页面" unless openid
|
|
|
|
raise "请在微信中关注公众号'Trustie创新实践平台'后再打开本页面" unless openid
|
|
|
|
|
|
|
|
uw = UserWechat.where(openid: openid).first
|
|
|
|
uw = UserWechat.where(openid: openid).first
|
|
|
|
raise "此微信号已绑定用户(#{uw.user.login}), 不能重复绑定" if uw
|
|
|
|
raise "此微信号已绑定用户(#{uw.user.login}), 不能重复绑定" if uw
|
|
|
|
|
|
|
|
|
|
|
@ -56,8 +55,7 @@ module Mobile
|
|
|
|
post do
|
|
|
|
post do
|
|
|
|
openid = session[:wechat_openid]
|
|
|
|
openid = session[:wechat_openid]
|
|
|
|
logger.debug "openid ============== #{openid}"
|
|
|
|
logger.debug "openid ============== #{openid}"
|
|
|
|
# raise "无法获取到openid,请在微信中打开本页面" unless openid
|
|
|
|
raise "无法获取到openid,请在微信中打开本页面" unless openid
|
|
|
|
raise "请在微信中关注Trustie创新实践平台后再打开本页面" unless openid
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
uw = UserWechat.where(openid: openid).first
|
|
|
|
uw = UserWechat.where(openid: openid).first
|
|
|
|
if uw
|
|
|
|
if uw
|
|
|
|