From acaea1901de95aaffc11683982fff3bfea1eda32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cxxq250=E2=80=9D?= <“xxq250@qq.com”> Date: Thu, 15 Sep 2022 13:52:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=8D=A2=E7=9F=AD=E4=BF=A1=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/accounts_controller.rb | 4 ++-- lib/gitlink/sms.rb | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index cf3fe756..17ccd256 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -27,7 +27,7 @@ class AccountsController < ApplicationController result = autologin_register(username, email, password, platform, phone) if result[:message].blank? PlatformStatistic.data.increment!(:users_count) - Gitlink::Sms.send(mobile: phone, send_type: 'init_password', code: password) if need_send_pwd_sms + Gitlink::Sms.send(mobile: phone, send_type: 'init_password', code: password, user_name: username) if need_send_pwd_sms render_ok({user: result[:user]}) else render_error(result[:message]) @@ -54,7 +54,7 @@ class AccountsController < ApplicationController return render_error("该手机号已注册") if phone.present? && User.where(phone: phone).exists? result = autologin_register(username, email, password, platform, phone) if result[:message].blank? - Gitlink::Sms.send(mobile: phone, send_type: 'init_password', code: password) + Gitlink::Sms.send(mobile: phone, send_type: 'init_password', code: password, user_name: username) PlatformStatistic.data.increment!(:users_count) render_ok({user: result[:user]}) else diff --git a/lib/gitlink/sms.rb b/lib/gitlink/sms.rb index 6acb239c..5f8b2482 100644 --- a/lib/gitlink/sms.rb +++ b/lib/gitlink/sms.rb @@ -38,7 +38,8 @@ module Gitlink if send_type.nil? params['text'] = "【红山开源平台】您的验证码是#{code}。如非本人操作,请忽略本短信。" elsif send_type == 'init_password' - params['text'] = "【红山开源平台】您的初始密码是#{code}。登录后请及时修改密码。" + # params['text'] = "【红山开源平台】您的初始密码是#{code}。登录后请及时修改密码。" + params['text'] = "【红山开源平台】尊敬的用户,您好!非常感谢您注册红山开源平台www.osredm.com ,以下是您的账户信息,请妥善保管。账号:#{user_name}(用户账户名)密码:#{code}(随机生成密码)" elsif send_type == 'competition_start' params['text'] = "【红山开源平台】亲爱的#{user_name},你参与的#{name}将于#{result}开始,请及时参赛" elsif send_type == 'authentication_pro' || send_type == 'authentication'|| send_type == 'trial_authorization' || send_type == 'project_info'