adjust auth apply

dev_ec
p31729568 5 years ago
parent 67a5ef4c55
commit 67ea6d5625

@ -25,9 +25,9 @@ class Users::ApplyAuthenticationService < ApplicationService
user.apply_user_authentication.create!(auth_type: 1, status: 0)
move_image_file! unless params[:upload_image].to_s == 'false'
end
sms_notify_admin
end
user
end

@ -37,13 +37,9 @@ class Users::ApplyProfessionalAuthService < ApplicationService
user.apply_user_authentication.create!(auth_type: 2, status: 0)
move_image_file! unless params[:upload_image].to_s == 'false'
end
sms_cache = Rails.cache.read("apply_pro_certification")
if sms_cache.nil?
sms_notify_admin
Rails.cache.write("apply_pro_certification", 1, expires_in: 5.minutes)
end
end
end
private
@ -61,7 +57,11 @@ class Users::ApplyProfessionalAuthService < ApplicationService
end
def sms_notify_admin
sms_cache = Rails.cache.read('apply_pro_certification')
if sms_cache.nil?
Educoder::Sms.notify_admin(send_type: 'apply_pro_certification')
Rails.cache.write('apply_pro_certification', 1, expires_in: 5.minutes)
end
rescue => ex
Util.logger_error(ex)
end

Loading…
Cancel
Save