Realize the internationalization of mobile phone numbers based on Ronglian Cloud Communication and Cloud Piece in Yii2.0.9
1. You need to refer to the previous website:https://www.shuijingwanwq.com/2016/07/09/1129/;
2. To obtain the implementation of the mobile phone registration verification code, it needs to only support the client version of mainland China before it is compatible. Therefore, the national area code ID is allowed to be empty, and the default value is 0, as shown in Figure 1:
3, the national area code ID is allowed to be empty, the default value is 0, as shown in Figure 2:
4. Keep the verification code in the cache for 1800 seconds, and its variable name is the splicing of the national area code ID and the mobile phone to maintain uniqueness, as shown in Figure 3:
5. The processing logic of sending template SMS is basically the same as the previous URL. If the sending is successful, the number of sendings within today is calculated and stored in the cache, so as to limit the number of sending times for a day, as shown in Figure 4:
6. The verification of the number of times the template text message is sent within a day is limited to 5 messages per day, as shown in Figure 5 and 6:
7. Based on the support of sending SMS from cloud slices, copy the yunpian of the previous website to \vendor\yunpian, as shown in Figure 7:
8. Edit\Common\Config\Main.php to define an alias, as shown in Figure 8:
aliass=>[
@yunpian=>@vendor/yunpian,
]#ATFP_CLOSE_Translate_span#,
9. Edit\Common\Config\params.php, configure the cloud chip SMS interface, as shown in Figure 9:
10. Search $globals in \vendor\yunpian[‘setting_config’][‘yunpian’], replace it with: yii::$app->params[‘yunpian’], as shown in Figure 10:
11. Based on the support of cloud chip sending SMS, copy the sms.php of the previous URL to \common\components\sms.php, in which is the corresponding class library that can refer to the cloud slice, as shown in Figure 11:12. The international SMS test is successful, as shown in Figure 12:









![在\vendor\yunpian中搜索$GLOBALS['setting_config']['yunpian'],将其替换为:Yii::$app->params['yunpian']](https://www.shuijingwanwq.com/wp-content/uploads/2016/07/10-4.png)

