|
|
|
@ -4,7 +4,17 @@ class BindUsersController < ApplicationController
|
|
|
|
|
def create
|
|
|
|
|
# user = CreateBindUserService.call(create_params)
|
|
|
|
|
#
|
|
|
|
|
if params[:type] == "qq"
|
|
|
|
|
begin
|
|
|
|
|
user = CreateBindUserService.call(current_user, create_params)
|
|
|
|
|
successful_authentication(user) if user.id != current_user.id
|
|
|
|
|
|
|
|
|
|
render_ok
|
|
|
|
|
rescue ApplicationService::Error => ex
|
|
|
|
|
render_error(ex.message)
|
|
|
|
|
end
|
|
|
|
|
else
|
|
|
|
|
begin
|
|
|
|
|
tip_exception '系统错误' if session[:unionid].blank?
|
|
|
|
|
|
|
|
|
|
bind_user = User.try_to_login(params[:username], params[:password])
|
|
|
|
@ -19,6 +29,8 @@ class BindUsersController < ApplicationController
|
|
|
|
|
rescue Exception => e
|
|
|
|
|
render_error(e.message)
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def new_user
|
|
|
|
|
current_user
|
|
|
|
|