|
|
@@ -40,23 +40,25 @@ class AliYunSmsService
|
|
40
|
40
|
switch ($templateId) {
|
|
41
|
41
|
case 'AUTHCODE':
|
|
42
|
42
|
// 移除所有非数字字符(保留+)
|
|
43
|
|
- $phone = preg_replace('/[^0-9+]/', '', $mobile);
|
|
44
|
|
- // 检查是否带国际区号
|
|
45
|
|
- if (strpos($phone, '+852') === 0) {
|
|
46
|
|
- // 格式:+85251234567 → 检查后8位
|
|
47
|
|
- $phone = substr($phone, 4);
|
|
48
|
|
- }
|
|
49
|
|
- if((strlen($phone) === 8 && preg_match('/^[569]\d{7}$/', $phone))) {
|
|
|
43
|
+ $mobile = preg_replace('/[^0-9+]/', '', $mobile);
|
|
|
44
|
+
|
|
|
45
|
+ if (strpos($mobile, '+') === false || strpos($mobile, '+86') === 0) {
|
|
|
46
|
+ if (strpos($mobile, '+86') === 0) {
|
|
|
47
|
+ $mobile = substr($mobile, 3);
|
|
|
48
|
+ }
|
|
|
49
|
+ $SignName = '融合华夏';
|
|
|
50
|
+ $TemplateCode = 'SMS_311255692';
|
|
|
51
|
+ $content = '【华夏幸福保】您的验证码是:' . $code;
|
|
|
52
|
+ } else {
|
|
|
53
|
+ if (strpos($mobile, '+') === 0) {
|
|
|
54
|
+ $mobile = substr($mobile, 1);
|
|
|
55
|
+ }
|
|
50
|
56
|
$SignName = '融合华夏';
|
|
51
|
57
|
$TemplateCode = 'SMS_492105133';
|
|
52
|
58
|
$templateParam = [
|
|
53
|
59
|
'code_zh' => $code,
|
|
54
|
60
|
'code_en' => $code
|
|
55
|
61
|
];
|
|
56
|
|
- } else if (strlen($phone) === 11 && preg_match('/^1[3-9]\d{9}$/', $phone)) {
|
|
57
|
|
- $SignName = '融合华夏';
|
|
58
|
|
- $TemplateCode = 'SMS_311255692';
|
|
59
|
|
- $content = '【华夏幸福保】您的验证码是:' . $code;
|
|
60
|
62
|
}
|
|
61
|
63
|
break;
|
|
62
|
64
|
case 'ONESELFCARRY':
|