Browse Source

短信切换方法

lizhen_gitee 2 months ago
parent
commit
fb06c5b66d
1 changed files with 3 additions and 3 deletions
  1. 3 3
      application/common/library/Sms.php

+ 3 - 3
application/common/library/Sms.php

@@ -103,14 +103,14 @@ class Sms
     //移动云短信https://mas.10086.cn/login
     public static function yidong_sms_temp($mobile,$code){
 
-        $url = 'https://112.35.10.201:28888/sms/submit';
+        $url = 'https://112.35.10.201:28888/sms/tmpsubmit';
         $data = [
             'ecName' => '江苏达富居家养老健康管理有限公司',
             'apId' => 'dafuhttps',
             'secretKey' => '&YY4vrJb',
             'templateId' => '8d7b57acbd5349789d80ce0453ca5900',
             'mobiles' => $mobile,
-            'params' => '[\"'.$code.'\"]',
+            'params' => json_encode([$code]),
             'sign' => 't9pYTpyiW', //黑名单的
             'addSerial' => '',
         ];
@@ -120,7 +120,7 @@ class Sms
         unset($data['secretKey']);
 
         $header = ["Content-Type:application/json;charset=UTF-8"];
-        $rs = curl_post($url,base64_encode(json_encode($data)),$header);
+        $rs = curl_post($url,base64_encode(json_encode($data,JSON_UNESCAPED_UNICODE)),$header);
 
         $rs = json_decode($rs,true);
         if(isset($rs['success']) && $rs['success'] == true){