mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-02 19:30:48 +08:00
个人资料修改手机号
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user