From f40794282f160f6cdece3e7f33cf05a0dc5551d2 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Fri, 17 Jun 2016 18:54:24 +0800 Subject: [PATCH] . --- app/api/mobile/apis/users.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/api/mobile/apis/users.rb b/app/api/mobile/apis/users.rb index 637f55565..5aee29fe2 100644 --- a/app/api/mobile/apis/users.rb +++ b/app/api/mobile/apis/users.rb @@ -14,7 +14,8 @@ module Mobile post 'wxbind' do openid = params[:openid] raise "无法获取到openid,请在微信中打开本页面" unless openid - raise "此微信号已绑定用户, 不能重复绑定" if UserWechat.where(openid: openid).first + uw = UserWechat.where(openid: openid).first + raise "此微信号已绑定用户(#{uw.user.login}), 不能重复绑定" if uw user, last_login_on = User.try_to_login(params[:login], params[:password]) raise "用户名或密码错误,请重新输入" unless user @@ -26,8 +27,8 @@ module Mobile openid: openid, user: user ) - ws = WechatService.new - ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台", user.login, format_time(Time.now)) + # ws = WechatService.new + # ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台", user.login, format_time(Time.now)) present status: 0 present message: '绑定成功' end