chengkun
2025-05-30 abb66a0e799e7ca613e8967a304e7c5ed00e034e
app/model/notice.model.php
@@ -503,19 +503,20 @@
    
    /**
     * @desc    短信验证码时效性
     * @param array $data
     * @param string $data
     * @return  boolean
     */
    public function checkTime($data) {
    public function checkTime($data = 0) {
        $cert_validity = $this->config['moblie_codetime'] * 60; // 验证码有效时间
        if (!$data) {
            return false;
        }
        $time = time();
        $ctime = bcsub($time, $data);
        $data = is_numeric($data) ?: 0;
        $ctime = round($time - $data, 2);
        if ($ctime <= $cert_validity) {
            return true;
        } else {
            return false;
        }
    }
@@ -835,7 +836,6 @@
            'TemplateParamSet' => [strval($data['code'])]
        ];
        $payload = json_encode($params, JSON_UNESCAPED_UNICODE);
        var_dump($payload);
        $endpoint = "https://sms.tencentcloudapi.com";
        $algorithm = "TC3-HMAC-SHA256";
        $timestamp = time();