修正验证码不能以0开头的问题

This commit is contained in:
2023-02-24 10:37:29 +08:00
parent e6afaf0913
commit b8dd0463a2
6 changed files with 59 additions and 4 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ class CodeService extends BaseService
$template_code = "SMS_243055263";
$template_param = array();
$template_param['code'] = (int)substr($generator->generate(),-4);
$template_param['code'] = mt_rand(1,9) . (int)substr($generator->generate(),-3);
// 发送短信
Dysms::sendSms($phone,$template_param,$template_code,1);