zilong 4 年之前
父節點
當前提交
3fd320fb4e
共有 3 個文件被更改,包括 6 次插入6 次删除
  1. 1 1
      app/Helpers/functions.php
  2. 1 1
      app/Http/Controllers/Api/V1/CommonController.php
  3. 4 4
      config/config.php

+ 1 - 1
app/Helpers/functions.php

xqd
@@ -249,7 +249,7 @@ if (!function_exists('aly_sm_request')) {
 
         try {
             $content = aly_sms_fetch_content($url, $method, "Signature={$signature}{$sortedQueryStringTmp}");
-            return json_decode($content);
+            return json_decode($content, true);
         } catch (Exception $e) {
             return false;
         }

+ 1 - 1
app/Http/Controllers/Api/V1/CommonController.php

xqd
@@ -238,7 +238,7 @@ class CommonController extends Controller
 
         $verify_code = generate_code();
         $result = send_sms($req['phone'], 'verify_template_code', ['code' => $verify_code]);
-        if (!$result){
+        if (empty($result['Code']) || $result['Code'] != 'OK'){
             return out(null, 30010, '验证码发送失败,请稍后重试');
         }
 

+ 4 - 4
config/config.php

xqd
@@ -26,10 +26,10 @@ return [
     'product_type_map' => [1 => '电话咨询', 2 => '图文咨询', 3 => '门诊预约', 4 => '疫苗接种预约', 5 => '儿保预约', 6 => '服务包', 7 => '充值'],
 
     'aly_sms' => [
-        'access_key' => 'LTAI4FgJdnfwsj5Bb6ioWSD9',
-        'access_secret' => 'S4Tp2eNVKHROuNOLjTvAICTnjqXFFR',
-        'sign_name' => '思维定制',
-        'verify_template_code' => 'SMS_185242509',
+        'access_key' => 'LTAI4GGMyBKstgVLLckoPxtf',
+        'access_secret' => 'goLufn8Qe0Mfip5PBR8R0DfbYYYkDF',
+        'sign_name' => '熙宝HMO',
+        'verify_template_code' => 'SMS_205875481',
         'sms_verify_code_expire' => 360,
     ],