1557492053 1 年之前
父節點
當前提交
d036c1db09

+ 1 - 1
addons/fastchat/config.php

@@ -138,7 +138,7 @@ return [
             '不开启',
             '开启',
         ],
-        'value' => '1',
+        'value' => '0',
         'rule' => '',
         'tip' => '请先参考常见问题配置好wss服务再开启,否则将无法链接',
         'ok' => '',

+ 0 - 1
application/admin/controller/activity/Lottery.php

@@ -51,7 +51,6 @@ class Lottery extends Backend
             list($where, $sort, $order, $offset, $limit) = $this->buildparams();
 
             $list = $this->model
-                    
                     ->where($where)
                     ->order($sort, $order)
                     ->paginate($limit);

+ 1 - 5
application/api/controller/Index.php

@@ -58,11 +58,7 @@ class Index extends Api
         sort($tmpArr, SORT_STRING);
         $tmpStr = implode($tmpArr);
         $tmpStr = sha1($tmpStr);
-        if ($tmpStr == $signature) {
-            return true;
-        } else {
-            return false;
-        }
+        return $tmpStr == $signature;
     }
 
 

+ 2 - 2
application/api/controller/Sms.php

@@ -26,9 +26,9 @@ class Sms extends Api
             "massager_modify_mobile", // 修改电话
             "massager_close_account", // 注销账户
         ]))
-            $this->error("发送类型不符合规则!");
+            $this->error("发送类型异常");
         $code = rand(1000, 9999);
-        $valid = TencentCloudService::tencent_cloud_sms_send("1913775", $mobile, [$code, 5]);
+        $valid = TencentCloudService::tencent_cloud_sms_send("2280835", $mobile, [$code]);
         if ($valid->code()) {
             \app\common\model\Sms::create(['event' => $event, 'mobile' => $mobile, 'code' => $code, 'ip' => request()->ip(), 'createtime' => time()]);
             $this->success(true);

+ 18 - 4
application/api/controller/Test.php

@@ -2,7 +2,7 @@
 
 namespace app\api\controller;
 
-use app\api\service\WxService;
+use app\api\service\TencentCloudService;
 use app\common\controller\Api;
 
 
@@ -11,13 +11,27 @@ class Test extends Api
 
     protected $noNeedLogin = ["*"];
 
+    function phpinfo()
+    {
+        dump(ini_get("oci8.default_prefetch"));
+        echo phpinfo();
+    }
+
     function payment()
     {
-        $service = (new WxService);
-        $SR = $service->appletPay("oQ_977SN3KhBetHY9OPckGP9DNNc", self::getRandomStr(20), "sbsbsb", 0.01);
-        $SR->code() ? $this->success($SR->data()) : $this->error($SR->msg());
+        $params = json_decode(file_get_contents("php://input"), true);
+        dump($params['A']);
+
+//        $service = (new WxService);
+//        $SR = $service->appletPay("oQ_977SN3KhBetHY9OPckGP9DNNc", self::getRandomStr(20), "sbsbsb", 0.01);
+//        $SR->code() ? $this->success($SR->data()) : $this->error($SR->msg());
     }
 
+    function sms()
+    {
+        $valid = TencentCloudService::tencent_cloud_sms_send("2280835", "15574920253", [random_int(1000, 9999)]);
+        $valid->code() ? $this->success($valid->data()) : $this->error($valid->msg());
+    }
 
     function test1()
     {

+ 4 - 2
application/api/service/TencentCloudService.php

@@ -20,6 +20,7 @@ class TencentCloudService extends BaseService
     public static $MASSAGE_APPLY = 1913772;
 
 
+    // TODO: 更换短信配置
     public static function tencent_cloud_sms_send($templateId, $mobile, $params)
     {
         try {
@@ -36,8 +37,8 @@ class TencentCloudService extends BaseService
             $clientProfile->setHttpProfile($httpProfile);
             $client = new SmsClient($cred, "ap-guangzhou", $clientProfile);
             $req = new SendSmsRequest();
-            $req->SmsSdkAppId = config("site.tencent_cloud_sms_sdk_app_id");
-            $req->SignName = config("site.tencent_cloud_sms_sign_name");
+            $req->SmsSdkAppId = Env::get("sms.tencent_cloud_sms_sdk_app_id");
+            $req->SignName = Env::get("sms.tencent_cloud_sms_sign_name");
             $req->TemplateId = $templateId;
             $req->TemplateParamSet = $params;
             $req->PhoneNumberSet = array("+86{$mobile}");
@@ -61,6 +62,7 @@ class TencentCloudService extends BaseService
                 config("site.tencent_cloud_secret_id"),
                 config("site.tencent_cloud_secret_key")
             );
+
             $httpProfile = new HttpProfile();
             $httpProfile->setReqMethod("POST");
             $httpProfile->setReqTimeout(30);