overtrue / easy-sms

📲 一款满足你的多种发送需求的短信发送组件
MIT License
3.1k stars 542 forks source link

使用国际号码发送短信时,使用 PhoneNumber 处理手机号码会丢失手机号 #314

Closed jesse7866 closed 2 years ago

jesse7866 commented 2 years ago

https://github.com/overtrue/easy-sms/blob/58e405f030574547d00710fc9538d8e0867620e2/src/PhoneNumber.php#L37-L51

https://github.com/overtrue/easy-sms/blob/58e405f030574547d00710fc9538d8e0867620e2/src/Gateways/QcloudGateway.php#L60

如果传手机区号了,那么 getIDDCode 只会获取区号,就没有手机号码了,发送短信会提示参数有误

使用版本 V2.0.1

overtrue commented 2 years ago

举例子看一下?

jesse7866 commented 2 years ago

例子:

$phone = new PhoneNumber(13212345678, 86);
app('easysms')->send($phone, new RegisterMessage($code));

因为我的业务有国际短信要发送,所以必须得使用区号

jesse7866 commented 2 years ago

多谢帮忙处理 👍

overtrue commented 2 years ago

@jesse7866 客气了。