|
|
|
@ -10,7 +10,7 @@ class Users::ApplyAuthenticationService < ApplicationService
|
|
|
|
|
raise Error, '请先完善基本信息' unless user.profile_completed?
|
|
|
|
|
|
|
|
|
|
Users::ApplyAuthenticationForm.new(params).validate!
|
|
|
|
|
raise Error, '您已经申请过实名认证了' if ApplyUserAuthentication.real_name_auth.processing.exists?(user_id: user.id)
|
|
|
|
|
# raise Error, '您已经申请过实名认证了' if ApplyUserAuthentication.real_name_auth.processing.exists?(user_id: user.id)
|
|
|
|
|
|
|
|
|
|
user.lastname = params[:name].to_s.strip
|
|
|
|
|
user.firstname = ''
|
|
|
|
@ -18,6 +18,8 @@ class Users::ApplyAuthenticationService < ApplicationService
|
|
|
|
|
user.show_realname = params[:show_realname].to_s == 'true' if params[:show_realname].to_s.present?
|
|
|
|
|
|
|
|
|
|
ActiveRecord::Base.transaction do
|
|
|
|
|
ApplyUserAuthentication.real_name_auth.processing.where(user_id: user.id).destroy_all
|
|
|
|
|
|
|
|
|
|
user.authentication = true
|
|
|
|
|
user.save!
|
|
|
|
|
|
|
|
|
|