<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # 阿里短信 ## 安裝依賴 ``` composer require mrgoon/aliyun-sms ``` ## 代碼 - file:`application/utils/Sms.php` ```php <?php namespace app\utils; use Mrgoon\AliSms\AliSms; use think\Exception; use think\facade\Cache; /** * 短信 */ class Sms { /** * 短信類型: 阿里云 */ const MODE_ALIYUN = 'aliyun'; /** * 發送短信 * * @param string $mode 短信類型, 參考Sms::MODE_ALIYUN * @param string $template_id 短信模板id * @param string $phone 手機號 * @param array $data 參數 * @return void * @throws think\Exception */ static function send($mode=Sms::MODE_ALIYUN, $template_id='', $phone, $data) { if (Cache::get(sprintf('SMS:%s', $phone))) // 短信一分鐘限制 throw new Exception('一分鐘內不能重復發送!', 1); switch ($mode) { case Sms::MODE_ALIYUN: (new self())->sms_aliyun($phone, $data, $template_id); break; } Cache::set(sprintf('SMS:%s', $phone), 1, 60); } // 阿里云短信發送 public function sms_aliyun($phone, $data, $template_id) { $config = [ 'access_key' => '你的access_key', 'access_secret' => '你的access_secret', 'sign_name' => '簽名名稱', ]; $aliSms = new AliSms(); $response = $aliSms->sendSms($phone, $template_id, $data, $config); if ($response->Code != 'OK') throw new Exception($response->Message, 1); return $response; } } ``` ## 使用 ```php Sms::send(Sms::MODE_ALIYUN, '短信模板id', '手機號', [參數...]); ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看