个人资料修改手机号

This commit is contained in:
2022-11-24 11:09:58 +08:00
parent aeff21f7df
commit fd2b20ed87
5 changed files with 63 additions and 4 deletions

View File

@@ -1,9 +1,10 @@
class Sms::UcloudService < ApplicationService
attr_reader :phone, :code
attr_reader :phone, :code, :send_type
def initialize(phone, code)
def initialize(phone, code, send_type)
@phone = phone
@code = code
@send_type = send_type
end
def call
@@ -14,7 +15,7 @@ class Sms::UcloudService < ApplicationService
sign_params = {
"Action" => "SendUSMSMessage",
"ProjectId" => project_id,
"TemplateId" => "UTA221114S2MGTY",
"TemplateId" => get_template_id(@send_type),
"PublicKey" => public_key,
"PhoneNumbers.0" => @phone,
"TemplateParams.0" => "#{@code}",
@@ -95,4 +96,17 @@ class Sms::UcloudService < ApplicationService
end
end
# 1注册手机验证码 2找回密码手机验证码 4绑定手机 9验证手机号有效
def get_template_id(send_type)
case send_type
when 1, 2, 9
"UTA221114S2MGTY"
when 4
"UTA22112486FXLZ"
else
"UTA221114S2MGTY"
end
end
end