remove chinese character in english sms message

master
yixian 3 years ago
parent 483fb0dc34
commit b73be018fa

@ -514,7 +514,7 @@ public class ManageAppServiceImp implements ManageAppService {
String nationCode = phone.getString("nation_code"); String nationCode = phone.getString("nation_code");
String phoneNumber = phone.getString("contact_phone"); String phoneNumber = phone.getString("contact_phone");
try { try {
smsSender.sendAuthCodeMessage(nationCode.trim(), phoneNumber, Locale.ENGLISH, new AuthCodeMessage("绑定手机号", codeKeyValue, 5)); smsSender.sendAuthCodeMessage(nationCode.trim(), phoneNumber, Locale.ENGLISH, new AuthCodeMessage("Binding mobile number", codeKeyValue, 5));
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new ServerErrorException("Phone number is wrong.Please try again."); throw new ServerErrorException("Phone number is wrong.Please try again.");

@ -2231,7 +2231,7 @@ public class RetailAppServiceImp implements RetailAppService {
String nationCode = phone.getString("nation_code").contains("+") ? phone.getString("nation_code").substring(1) : phone.getString("nation_code"); String nationCode = phone.getString("nation_code").contains("+") ? phone.getString("nation_code").substring(1) : phone.getString("nation_code");
String phoneNumber = phone.getString("contact_phone"); String phoneNumber = phone.getString("contact_phone");
try { try {
smsSender.sendAuthCodeMessage(nationCode.trim(), phoneNumber, Locale.ENGLISH, new AuthCodeMessage("绑定手机号", codeKeyValue, 1)); smsSender.sendAuthCodeMessage(nationCode.trim(), phoneNumber, Locale.ENGLISH, new AuthCodeMessage("Binding mobile number", codeKeyValue, 1));
} catch (Exception e) { } catch (Exception e) {
logger.error(e.getMessage(), e); logger.error(e.getMessage(), e);
throw new BadRequestException("Phone number is wrong.Please try again."); throw new BadRequestException("Phone number is wrong.Please try again.");
@ -2251,7 +2251,7 @@ public class RetailAppServiceImp implements RetailAppService {
String nationCode = client.getString("nation_code").contains("+") ? client.getString("nation_code").substring(1) : client.getString("nation_code"); String nationCode = client.getString("nation_code").contains("+") ? client.getString("nation_code").substring(1) : client.getString("nation_code");
String phoneNumber = client.getString("contact_phone"); String phoneNumber = client.getString("contact_phone");
try { try {
smsSender.sendAuthCodeMessage(nationCode.trim(), phoneNumber, Locale.ENGLISH, new AuthCodeMessage("解綁绑定手机号", codeKeyValue, 1)); smsSender.sendAuthCodeMessage(nationCode.trim(), phoneNumber, Locale.ENGLISH, new AuthCodeMessage("Unbind mobile number", codeKeyValue, 1));
} catch (Exception e) { } catch (Exception e) {
logger.error(e.getMessage(), e); logger.error(e.getMessage(), e);
throw new BadRequestException("Phone number is wrong.Please try again."); throw new BadRequestException("Phone number is wrong.Please try again.");

@ -571,7 +571,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
}); });
break; break;
case "phone": case "phone":
smsSender.sendAuthCodeMessage(account.getString("nation_code").trim(), account.getString("contact_phone"), Locale.ENGLISH, new AuthCodeMessage("密码重置服务", codeKeyValue, 5)); smsSender.sendAuthCodeMessage(account.getString("nation_code").trim(), account.getString("contact_phone"), Locale.ENGLISH, new AuthCodeMessage("Reset password", codeKeyValue, 5));
break; break;
} }
stringRedisTemplate.boundValueOps(getResetClientAccountKey(accountId)).set(codeKeyValue, 5, TimeUnit.MINUTES); stringRedisTemplate.boundValueOps(getResetClientAccountKey(accountId)).set(codeKeyValue, 5, TimeUnit.MINUTES);
@ -607,7 +607,7 @@ public class SignInAccountServiceImpl implements SignInAccountService, Applicati
}); });
break; break;
case "phone": case "phone":
smsSender.sendAuthCodeMessage(account.getString("nation_code").trim(), account.getString("phone"), Locale.CHINESE, new AuthCodeMessage("密码重置服务",codeKeyValue,5)); smsSender.sendAuthCodeMessage(account.getString("nation_code").trim(), account.getString("phone"), Locale.CHINESE, new AuthCodeMessage("密码重置服务", codeKeyValue,5));
break; break;
} }
stringRedisTemplate.boundValueOps(getResetManagerAccountKey(managerId)).set(codeKeyValue, 5, TimeUnit.MINUTES); stringRedisTemplate.boundValueOps(getResetManagerAccountKey(managerId)).set(codeKeyValue, 5, TimeUnit.MINUTES);

@ -7,7 +7,6 @@ import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
import com.github.qcloudsms.SmsSingleSender; import com.github.qcloudsms.SmsSingleSender;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.util.Locale; import java.util.Locale;

@ -1,7 +1,5 @@
package au.com.royalpay.payment.manage.support.sms.daas; package au.com.royalpay.payment.manage.support.sms.daas;
import org.springframework.util.MultiValueMap;
public interface DaasMessageTemplate { public interface DaasMessageTemplate {
String getMessage(); String getMessage();

@ -6,8 +6,6 @@ import org.junit.jupiter.api.Test;
import java.util.Locale; import java.util.Locale;
import static org.junit.jupiter.api.Assertions.*;
class SmsSenderDaasImplTest { class SmsSenderDaasImplTest {
private SmsSender sender; private SmsSender sender;

Loading…
Cancel
Save