ppypp伦理天堂,91手机在线视频,免费在线观看黄色毛片,夜夜穞天天穞狠狠穞AV美女按摩

聯系官方銷售客服

1835022288

028-61286886

投訴 已解決 如何判斷當前的驗證碼是來自用戶注冊還是修改手機還是重置密碼? 3 0
rewalax(全能人才) SVIP會員 OEM版權 2019-12-19 15:18:18 私信
迅睿CMS版本:4.3.4

請問如何判斷當前的驗證碼是來自用戶注冊還是修改手機還是重置密碼?

官方代碼中的短信發送方法中傳遞的參數無法判斷,現在需要根據不同的操作發送不同的短信模板,請問有什么辦法,謝謝。

public function sendsms_text($mobile, $content, $type = 'text') {

    if (!$mobile || !$content) {
        return dr_return_data(0, dr_lang('手機號碼或內容不能為空'));
    }

    $file = WRITEPATH.'config/sms.php';
    if (!is_file($file)) {
        log_message('error', '短信接口配置文件不存在');
        return dr_return_data(0, dr_lang('接口配置文件不存在'));
    }

    $config = require_once $file;
    if ($config['third']) {
        if (is_file(ROOTPATH.'config/mysms.php')) {
            require_once ROOTPATH.'config/mysms.php';
        }
        $method = 'my_sendsms_'.$type;
        if (function_exists($method)) {
            return call_user_func_array($method, [
                $mobile,
                $content,
                $config['third'],
            ]);
        } else {
            $error = dr_lang('你沒有定義第三方短信接口: '. $method);
            @file_put_contents(WRITEPATH.'sms_log.php', date('Y-m-d H:i:s').' ['.$mobile.'] ['.$error.'] ('.str_replace(array(chr(13), chr(10)), '', $content).')'.PHP_EOL, FILE_APPEND);
            return dr_return_data(0, $error);
        }
    } else {
        $content = $type == 'code' ? dr_lang('您的本次驗證碼是: %s', $content) : $content;
        $url = 'http://www.zbshanke.com/index.php?s=vip&c=home&uid='.$config['uid'].'&key='.$config['key'].'&mobile='.$mobile.'&content='.$content.'【'.$config['note'].'】&domain='.trim(str_replace('http://', '', SITE_URL), '/').'&sitename='.SITE_NAME;
        $result = dr_catcher_data($url);
        if (!$result) {
            log_message('error', '訪問官方云短信服務器失敗');
            return dr_return_data(0, dr_lang('訪問官方云短信服務器失敗'));
        }
        $result = json_decode($result, true);
    }

    @file_put_contents(WRITEPATH.'sms_log.php', date('Y-m-d H:i:s').' ['.$mobile.'] ['.$result['msg'].'] ('.str_replace(array(chr(13), chr(10)), '', $content).')'.PHP_EOL, FILE_APPEND);

    return $result;
}
解決方案