|
|
@ -17,6 +17,7 @@ class CreateBindUserService < ApplicationService
|
|
|
|
|
|
|
|
|
|
|
|
bind_user = User.try_to_login(params[:username], params[:password])
|
|
|
|
bind_user = User.try_to_login(params[:username], params[:password])
|
|
|
|
raise Error, '用户名或者密码错误' if bind_user.blank?
|
|
|
|
raise Error, '用户名或者密码错误' if bind_user.blank?
|
|
|
|
|
|
|
|
raise Error, '该账号已被绑定' if bind_user.bind_open_user?(params[:type].to_s)
|
|
|
|
|
|
|
|
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
open_user.user_id = bind_user.id
|
|
|
|
open_user.user_id = bind_user.id
|
|
|
|