精品深夜福利视频,日本中文字幕不卡,久久久久国产,av综合电影网站


待發(fā)短信

在線客服
產(chǎn)品支持 短信寶客服
合作渠道 渠道合作
服務(wù)咨詢

4001-021-502

工作時間

9:00-21:00

EyouCMS-V1.7.5-新增短信寶短信接口

EyouCms是基于TP5.0框架為核心開發(fā)的穩(wěn)定+開源的企業(yè)內(nèi)容管理系統(tǒng)。營銷功能采用插件化的方式方便擴(kuò)展、二次開發(fā)系統(tǒng)大小任意控制。小編帶著大家一起開發(fā)EyouCMS-V1.7.5的短信寶插件接口。我們使用的短信接口是我們短信寶短信群發(fā)平臺的短信接口,我們短信寶短信群發(fā)平臺非常穩(wěn)定,發(fā)送速度快,注冊就送測試短信,推薦大家使用。
首先執(zhí)行以下SQL增加短信寶短信模板內(nèi)容

1
2
3
4
5
6
7
8
9
10
INSERT INTO `ey_sms_template` VALUES '44','3''賬號注冊''''smsbao''驗證碼為 ${content} ,請在30分鐘內(nèi)輸入驗證。''0''0''cn''1591262356''1591262356');
INSERT INTO `ey_sms_template` VALUES ('45''3''手機(jī)綁定''''smsbao''驗證碼為 ${content} ,請在30分鐘內(nèi)輸入驗證。''1''0''cn''1591262356''1591262356');
INSERT INTO `ey_sms_template` VALUES ('46''3''找回密碼''''smsbao''驗證碼為 ${content} ,請在30分鐘內(nèi)輸入驗證。''4''0''cn''1591262356''1591262356');
INSERT INTO `ey_sms_template` VALUES ('47''3''訂單付款''''smsbao''您有新的消息:您有新的${content}訂單,請注意查收!''5''1''cn''1591262356''1616460912');
INSERT INTO `ey_sms_template` VALUES ('48''3''訂單發(fā)貨''''smsbao''您有新的消息:您有新的${content}訂單,請注意查收!''6''1''cn''1591262356''1616460912');
INSERT INTO `ey_sms_template` VALUES ('49''3''留言驗證''''smsbao''驗證碼為 ${content} ,請在30分鐘內(nèi)輸入驗證。''7''1''cn''1591262356''1591262356');
INSERT INTO `ey_sms_template` VALUES ('50''3''賬號登錄''''smsbao''驗證碼為 ${content} ,請在30分鐘內(nèi)輸入驗證。''2''1''cn''1591262356''1591262356');
INSERT INTO `ey_sms_template` VALUES ('51''3''留言表單''''smsbao''您有新的留言消息,請查收!''11''1''cn''1591262356''1591262356');
INSERT INTO `ey_sms_template` VALUES ('52''3''投稿提醒''''smsbao''您有新的會員投稿,請查看!''20''1''cn''1591262356''1591262356');
INSERT INTO `ey_sms_template` VALUES ('53''3''后臺登錄''''smsbao''驗證碼為 ${content} ,請在30分鐘內(nèi)輸入驗證。''30''1''cn''1591262356''1591262356');

接著打開項目:application\admin\template\system\sms.htm 文件,增加短信寶信息配置代碼

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
{include file="public/layout" /}
<body class="bodystyle" style="overflow-y: scroll;min-width:auto;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page min-hg-c-i" style="min-width: auto;box-shadow:none;">
    <div class="fixed-bar">
        <div class="item-title">
            <a class="back_xin" href="{:url('System/api_conf')}" title="返回"><i class="iconfont e-fanhui"></i></a>
            <div class="subject">
                <h3>云短信</h3>
                <h5></h5>
            </div>
            <ul class="tab-base nc-row">
                {eq name="'System@sms'|is_check_access" value="1"}
                <li><a href="{:url('System/sms')}" {if condition="'sms'==$Think.const.ACTION_NAME"}class="current"{/if}><span>短信配置</span></a></li>
                {/eq}
 
                {eq name="'System@sms_tpl'|is_check_access" value="1"}
                <li><a href="{:url('System/sms_tpl')}" {if condition="'sms_tpl'==$Think.const.ACTION_NAME"}class="current"{/if}><span>自定義模板</span></a></li>
                {/eq}
            </ul>
        </div>
    </div>
    <form class="form-horizontal" id="postSmsForm" method="post">
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit">
                    <label for="sms_type">短信平臺</label>
                </dt>
                <dd class="opt">
                    <label class="curpoin"><input type="radio" name="sms_type" value="3" onclick="changeSmsType(this);" {if condition="empty($sms.sms_type) || $sms.sms_type eq 3"}checked="checked"{/if}>短信寶短信</label>
                    &nbsp;&nbsp;
                    <label class="curpoin"><input type="radio" name="sms_type" value="1" onclick="changeSmsType(this);" {if condition="empty($sms.sms_type) || $sms.sms_type eq 1"}checked="checked"{/if}>阿里云短信</label>
                    &nbsp;&nbsp;
                    <label class="curpoin"><input type="radio" name="sms_type" value="2" onclick="changeSmsType(this);" {if condition="isset($sms.sms_type) && $sms.sms_type eq 2"}checked="checked"{/if}>騰訊云短信</label>
                    <!-- ToSms短信通知插件內(nèi)置代碼 start -->
                    {if condition="file_exists(ROOT_PATH.'weapp/ToSms/template/admin/system/sms_type.htm')"}
                        {include file="/weapp/ToSms/template/admin/system/sms_type.htm" /}
                    {/if}
                    <!-- ToSms短信通知插件內(nèi)置代碼 end -->
                    <input type="hidden" id="old_sms_type" value="{if condition="empty($sms.sms_type) || $sms.sms_type eq 1"}1{else /}{$sms.sms_type}{/if}">
                    <p class="notic"></p>
                </dd>
            </dl>
            <dl class="row" id="sms_appkey_3" style="display: {if condition="!isset($sms.sms_type) || $sms.sms_type eq 3"} block{else /}none{/if};">
                <dt class="tit">
                    <em>*</em>
                    <label for="sms_smsbao_user">短信寶賬號</label>
                </dt>
                <dd class="opt">
                    <input id="sms_smsbao_user" name="sms_smsbao_user" value="{$sms.sms_smsbao_user|default=''}" class="input-txt" type="text" autocomplete="off" />
                    <p class="notic">短信寶賬號</p>
                </dd>
            </dl>
            <dl class="row" id="sms_secretkey_3" style="display: {if condition="!isset($sms.sms_type) || $sms.sms_type eq 3"} block{else /}none{/if};">
                <dt class="tit">
                    <em>*</em>
                    <label for="sms_smsbao_apikey">短信寶apikey</label>
                </dt>
                <dd class="opt">
                    <input id="sms_smsbao_apikey" name="sms_smsbao_apikey" value="{$sms.sms_smsbao_apikey|default=''}" class="input-txt" type="text" autocomplete="off" />
                    <p class="notic">短信寶apikey</p>
                </dd>
            </dl>
             
            <dl class="row" id="sms_appkey_1" style="display: {if condition="!isset($sms.sms_type) || $sms.sms_type eq 1"} block{else /}none{/if};" >
                <dt class="tit">
                    <em>*</em>
                    <label for="sms_appkey">平臺appkey</label>
                </dt>
                <dd class="opt">
                    <input id="sms_appkey" name="sms_appkey" value="{$sms.sms_appkey|default=''}" class="input-txt" type="text" autocomplete="off" />
                    <p class="notic">短信平臺配置appkey</p>
                </dd>
            </dl>
            <dl class="row" id="sms_secretkey_1" style="display: {if condition="!isset($sms.sms_type) || $sms.sms_type eq 1"} block{else /}none{/if};">
                <dt class="tit">
                    <em>*</em>
                    <label for="sms_secretkey">平臺secretKey</label>
                </dt>
                <dd class="opt">
                    <input id="sms_secretkey" name="sms_secretkey" value="{$sms.sms_secretkey|default=''}" class="input-txt" type="text" autocomplete="off" />
                    <p class="notic">短信平臺配置secretKey</p>
                </dd>
            </dl>
 
            <dl class="row" id="sms_secretkey_2" style="display: {if condition="!isset($sms.sms_type) || $sms.sms_type eq 2"} block{else /}none{/if};">
                <dt class="tit">
                    <em>*</em>
                    <label for="sms_appid_tx">平臺appid</label>
                </dt>
                <dd class="opt">
                    <input id="sms_appid_tx" name="sms_appid_tx" value="{$sms.sms_appid_tx|default=''}" class="input-txt" type="text" autocomplete="off" />
                    <p class="notic">短信平臺配置appid</p>
                </dd>
            </dl>
            <dl class="row" id="sms_appkey_2" style="display: {if condition="!isset($sms.sms_type) || $sms.sms_type eq 2"} block{else /}none{/if};">
                <dt class="tit">
                    <em>*</em>
                    <label for="sms_appkey_tx">平臺appkey</label>
                </dt>
                <dd class="opt">
                    <input id="sms_appkey_tx" name="sms_appkey_tx" value="{$sms.sms_appkey_tx|default=''}" class="input-txt" type="text" autocomplete="off" />
                    <p class="notic">短信平臺配置appkey</p>
                </dd>
            </dl>
            <!-- ToSms短信通知插件內(nèi)置代碼 start -->
            {if condition="file_exists(ROOT_PATH.'weapp/ToSms/template/admin/system/sms_conf.htm')"}
                {include file="/weapp/ToSms/template/admin/system/sms_conf.htm" /}
            {/if}
            <!-- ToSms短信通知插件內(nèi)置代碼 end -->
            <dl class="row none">
                <dt class="tit"><em>*</em>管理員手機(jī)號區(qū)號</dt>
                <dd class="opt">
                    + &nbsp;<input value="{$sms.sms_nation_code|default='86'}" name="sms_nation_code" id="sms_nation_code" style="width: 60px !important;text-align: right;" placeholder="例如中國的區(qū)號:86" class="input-txt" type="text" onkeyup="this.value=this.value.replace(/[^\d]/g,'');" onpaste="this.value=this.value.replace(/[^\d]/g,'')" autocomplete="off">
                    <p class="notic">如存在多個管理員手機(jī)號,僅支持同一個國家的手機(jī)號</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit"><em>*</em>管理員手機(jī)號</dt>
                <dd class="opt">
                    <input value="{$sms.sms_test_mobile|default=''}" name="sms_test_mobile" id="sms_test_mobile" placeholder="多個手機(jī)號碼可以用逗號隔開" class="input-txt" type="text" onkeyup="this.value=this.value.replace(/,/g,',');" onpaste="this.value=this.value.replace(/,/g,',')" autocomplete="off">
                    <input value="測試發(fā)送" class="input-btn" onclick="sendMobile();" type="button">
                    <p class="notic">多個手機(jī)號碼可以用逗號隔開</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">接收提醒選項</dt>
                <dd class="opt">
                    <ul class="nc-row ncap-waybill-list ul_tpl_id3 {if condition='!empty($sms.sms_type) && $sms.sms_type neq 3'}none{/if}">
                        <li style="width: 100%;" >
                            {foreach name="sms_list3" item="vo" key="k" }
                            <label class="label">
                                <input class="check" type="checkbox" name="tpl_id[3][]" value="{$vo.tpl_id}" {eq name="$vo.is_open" value="1" }checked="checked"{/eq}><span>{$vo.tpl_title}</span>
                            </label>
                            &nbsp;
                            {/foreach}
                        </li>
                    </ul>
                    <ul class="nc-row ncap-waybill-list ul_tpl_id1 {if condition='!empty($sms.sms_type) && $sms.sms_type neq 1'}none{/if}">
                        <li style="width: 100%;" >
                            {foreach name="sms_list1" item="vo" key="k" }
                            <label class="label">
                                <input class="check" type="checkbox" name="tpl_id[1][]" value="{$vo.tpl_id}" {eq name="$vo.is_open" value="1" }checked="checked"{/eq}><span>{$vo.tpl_title}</span>
                            </label>
                            &nbsp;
                            {/foreach}
                        </li>
                    </ul>
                    <ul class="nc-row ncap-waybill-list ul_tpl_id2 {if condition='!empty($sms.sms_type) && $sms.sms_type neq 2'}none{/if}">
                        <li style="width: 100%;">
                            {foreach name="sms_list2" item="vo" key="k" }
                            <label class="label">
                                <input class="check" type="checkbox" name="tpl_id[2][]" value="{$vo.tpl_id}" {eq name="$vo.is_open" value="1" }checked="checked"{/eq}><span>{$vo.tpl_title}</span>
                            </label>
                            &nbsp;
                            {/foreach}
                        </li>
                    </ul>
                    <!-- ToSms短信通知插件內(nèi)置代碼 start -->
                    {if condition="file_exists(ROOT_PATH.'weapp/ToSms/template/admin/system/sms_open.htm')"}
                        {include file="/weapp/ToSms/template/admin/system/sms_open.htm" /}
                    {/if}
                    <!-- ToSms短信通知插件內(nèi)置代碼 end -->
                </dd>
            </dl>
            <dl class="row">
                <div class="bot" style="padding-bottom:0px;">
                    <a href="JavaScript:void(0);" onclick="submit_sms();" class="ncap-btn-big ncap-btn-green">確認(rèn)提交</a>
                    &nbsp;<a href="JavaScript:void(0);" onclick="openArticle()" style="font-size: 12px;padding-left: 10px;position:absolute;top: 30px">不會配置?</a>
                </div>
            </dl>
        </div>
    </form>
</div>
<script type="text/javascript">
    var parentObj = parent.layer.getFrameIndex(window.name); //先得到當(dāng)前iframe層的索引
    function submit_sms(){
        var sms_type = $("#old_sms_type").val();
        if (sms_type == 3) {
            if ($('#postSmsForm input[name="sms_smsbao_user"]').val() == '') {
                showErrorMsg('請?zhí)顚懚绦艑氋~號!');
                $('#postSmsForm input[name=sms_smsbao_user]').focus();
                return false;
            }
            if ($('#postSmsForm input[name="sms_smsbao_apikey"]').val() == '') {
                showErrorMsg('請?zhí)顚懚绦艑歛pikey!');
                $('#postSmsForm input[name=sms_smsbao_apikey]').focus();
                return false;
            }
        }else if (sms_type == 1) {
            if ($('#postSmsForm input[name="sms_appkey"]').val() == '') {
                showErrorMsg('請?zhí)顚懚绦牌脚_[appkey]!');
                $('#postSmsForm input[name=sms_appkey]').focus();
                return false;
            }
            if ($('#postSmsForm input[name="sms_secretkey"]').val() == '') {
                showErrorMsg('請?zhí)顚懚绦牌脚_[secretKey]!');
                $('#postSmsForm input[name=sms_secretkey]').focus();
                return false;
            }
        }else if (sms_type == 2){
            if ($('#postSmsForm input[name="sms_appkey_tx"]').val() == '') {
                showErrorMsg('請?zhí)顚懚绦牌脚_[appkey]!');
                $('#postSmsForm input[name=sms_appkey_tx]').focus();
                return false;
            }
            if ($('#postSmsForm input[name="sms_appid_tx"]').val() == '') {
                showErrorMsg('請?zhí)顚懚绦牌脚_[appid]!');
                $('#postSmsForm input[name=sms_appid_tx]').focus();
                return false;
            }
        }else{
            {$submitSmsJsCode|default=''}
        }
 
        var mobile = $('#sms_test_mobile').val();
        if (mobile == '') {
            showErrorMsg('管理員手機(jī)號不能為空!');
            $('#postSmsForm input[name=sms_test_mobile]').focus();
            return false;
        }
 
        layer_loading("正在處理");
        $.ajax({
            url: "{:url('System/sms', ['_ajax'=>1])}",
            type: 'POST',
            dataType: 'JSON',
            data: $('#postSmsForm').serialize(),
            success: function(res){
                layer.closeAll();
                if (1 == res.code) {
                    // layer.msg(res.msg, {shade: 0.1, time: 1000}, function(){
                    //     window.location.reload();
                    // });
                } else {
                    var icon = 5;
                    try{
                        if (res.data.icon) {
                            icon = res.data.icon;
                        }
                    }catch(e){}
                    showErrorAlert(res.msg, icon);
                }
            },
            error: function(e){
                layer.closeAll();
                showErrorAlert(e.responseText);
            }
        });
    }
 
    function sendMobile() {
        var sms_type = $("#old_sms_type").val();
        if (sms_type == 3) {
            if ($('#postSmsForm input[name="sms_smsbao_user"]').val() == '') {
                showErrorMsg('請?zhí)顚懚绦艑氋~號!');
                $('#postSmsForm input[name=sms_smsbao_user]').focus();
                return false;
            }
            if ($('#postSmsForm input[name="sms_smsbao_apikey"]').val() == '') {
                showErrorMsg('請?zhí)顚懚绦艑歛pikey!');
                $('#postSmsForm input[name=sms_smsbao_apikey]').focus();
                return false;
            }
        }else if (sms_type == 1) {
            if ($('#postSmsForm input[name="sms_appkey"]').val() == '') {
                showErrorMsg('請?zhí)顚懚绦牌脚_[appkey]!');
                $('#postSmsForm input[name=sms_appkey]').focus();
                return false;
            }
            if ($('#postSmsForm input[name="sms_secretkey"]').val() == '') {
                showErrorMsg('請?zhí)顚懚绦牌脚_[secretKey]!');
                $('#postSmsForm input[name=sms_secretkey]').focus();
                return false;
            }
       }else if (sms_type == 2){
            if ($('#postSmsForm input[name="sms_appkey_tx"]').val() == '') {
                showErrorMsg('請?zhí)顚懚绦牌脚_[appkey]!');
                $('#postSmsForm input[name=sms_appkey_tx]').focus();
                return false;
            }
            if ($('#postSmsForm input[name="sms_appid_tx"]').val() == '') {
                showErrorMsg('請?zhí)顚懚绦牌脚_[appid]!');
                $('#postSmsForm input[name=sms_appid_tx]').focus();
                return false;
            }
        } else {
            {$sendMobileJsCode|default=''}
        }
         
        var mobile = $('#sms_test_mobile').val();
        if (mobile == '') {
            showErrorMsg('管理員手機(jī)號不能為空!');
            $('#postSmsForm input[name=sms_test_mobile]').focus();
            return false;
        }
        var loading = layer_loading('發(fā)送中');
        $.ajax({
            type: "post",
            data: $('#postSmsForm').serialize(),
            dataType: 'json',
            url: "{:url('System/send_mobile')}",
            success: function (res) {
                layer.closeAll();
                if (res.code == 1) {
                    layer.msg('發(fā)送成功', {icon: 1, time:1000});
                } else {
                    layer.msg(res.msg, {icon: 2, time: 1000});
                }
            },
            error: function(e){
                layer.closeAll();
                showErrorAlert(e.responseText);
            }
        })
    }
 
    function changeSmsType(obj) {
        var new_sms_type = $("input[name=sms_type]:checked").val();
        var old_sms_type = $("#old_sms_type").val();
        if (new_sms_type) {
            $("#sms_appkey_"+old_sms_type).hide();
            $("#sms_secretkey_"+old_sms_type).hide();
            $("#sms_appkey_"+new_sms_type).show();
            $("#sms_secretkey_"+new_sms_type).show();
            $("#old_sms_type").val(new_sms_type);
            $(".ul_tpl_id"+new_sms_type).show();
            $(".ul_tpl_id"+old_sms_type).hide();
            {$changeSmsTypeJsCode|default=''}
        }
    }
 
    function openArticle() {
        var new_sms_type = $("input[name=sms_type]:checked").val();
        var aid = new_sms_type == 1 ? 8754 : 11143;
        click_to_eyou_1575506523('
    }
</script
 
{include file="public/footer" /}

接著打開項目:application\admin\template\system\sms_tpl.htm,在44~46行左右增加以下代碼

1
2
3
<label class="member-nav-item">
    <input type="button" class="btn {if condition="$sms_type == 3"}selected{else/}current{/if}" value="短信寶" onclick="window.location.href='{:url("System/sms_tpl", ["sms_type"=>3])}';">
</label>

接著打開項目:application\admin\controller\System.php,替換sms,sms_tpl函數(shù)方法

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
  /**
     * 短信配置
     */
    public function sms()
    {
        $inc_type =  'sms';
        if (IS_POST) {
            $param = input('post.');
            empty($param['sms_shop_order_pay']) && $param['sms_shop_order_pay'] = 0;
            empty($param['sms_guestbook_send']) && $param['sms_guestbook_send'] = 0;
 
            if (!isset($param['sms_type'])) $param['sms_type'] = 1;
            if ($param['sms_type'] == 3) {
                unset($param['sms_smsbao_user']);
                unset($param['sms_smsbao_apikey']);
            }else if ($param['sms_type'] == 1) {
                unset($param['sms_appkey_tx']);
                unset($param['sms_appid_tx']);
            }else {
                unset($param['sms_appkey']);
                unset($param['sms_secretkey']);
            }
            if (!empty($param['sms_type'])){
                if (!empty($param['tpl_id'][$param['sms_type']])){
                    Db::name('sms_template')->where('sms_type',$param['sms_type'])->where('tpl_id','in',$param['tpl_id'][$param['sms_type']])->update(['is_open'=>1,'update_time'=>getTime()]);
                    Db::name('sms_template')->where('sms_type',$param['sms_type'])->where('tpl_id','not in',$param['tpl_id'][$param['sms_type']])->update(['is_open'=>0,'update_time'=>getTime()]);
                }else{
                    Db::name('sms_template')->where('sms_type',$param['sms_type'])->where('tpl_id','>',0)->update(['is_open'=>0,'update_time'=>getTime()]);
                }
            }
            if (isset($param['tpl_id'])) unset($param['tpl_id']);
 
            /*多語言*/
            if (is_language()) {
                $langRow = \think\Db::name('language')->order('id asc')
                    ->cache(true, EYOUCMS_CACHE_TIME, 'language')
                    ->select();
                foreach ($langRow as $key => $val) {
                    tpCache($inc_type$param$val['mark']);
                }
            else {
                tpCache($inc_type$param);
            }
            /*--end*/
 
            $this->success('操作成功', url('System/sms'));
        }
 
        $assign_data = [];
        $sms = tpCache('sms');
        if (!isset($sms['sms_type'])) {
            $sms['sms_type'] = 1;
            tpCache('sms'array('sms_type'=>1));
        }
        $assign_data['sms'] = $sms;
 
        $map = [
            'send_scene'=>['neq',30],
            'lang' => $this->admin_lang,
        ];
        $map['sms_type'] = 3;
        $assign_data['sms_list3'] = Db::name('sms_template')->where($map)->order('tpl_id asc')->select();
        $map['sms_type'] = 1;
        $assign_data['sms_list1'] = Db::name('sms_template')->where($map)->order('tpl_id asc')->select();
        $map['sms_type'] = 2;
        $assign_data['sms_list2'] = Db::name('sms_template')->where($map)->order('tpl_id asc')->select();
 
        // ToSms短信通知插件內(nèi)置代碼 start
        if (file_exists('./weapp/ToSms/model/ToSmsModel.php')) {
            $toSmsModel new \weapp\ToSms\model\ToSmsModel;
            $toSmsModel->admin_System_sms($assign_data);
        }
        // ToSms短信通知插件內(nèi)置代碼 end
 
        $this->assign($assign_data);
        return $this->fetch();
    }
 
    /**
     * 短信模板列表
     */
    public function sms_tpl()
    {
        $param = input('param.');
        $list array();
        $keywords = input('keywords/s');
        $sms_type = input('sms_type/d');
        if (empty($sms_type)) {
            $sms_type = tpCache('sms.sms_type');
            $sms_type = !empty($sms_type) ? $sms_type : 1;
        }
 
        $map = [
            'lang' => $this->admin_lang,
            'sms_type' => $sms_type,
        ];
        if (!empty($keywords)) $map['tpl_title'] = array('LIKE'"%{$keywords}%");
 
        $count = Db::name('sms_template')->where($map)->count('tpl_id');// 查詢滿足要求的總記錄數(shù)
        $pageObj new Page($count, config('paginate.list_rows'));// 實例化分頁類 傳入總記錄數(shù)和每頁顯示的記錄數(shù)
        $list = Db::name('sms_template')->where($map)
            ->order('tpl_id asc')
            ->limit($pageObj->firstRow.','.$pageObj->listRows)
            ->select();
        $pageStr $pageObj->show(); // 分頁顯示輸出
        $this->assign('list'$list); // 賦值數(shù)據(jù)集
        $this->assign('page'$pageStr); // 賦值分頁輸出
        $this->assign('pager'$pageObj); // 賦值分頁對象
        $this->assign('sms_type'$sms_type); // 短信服務(wù)商
 
        // 是否填寫手機(jī)短信配置
        $is_conf = 1;
        $sms_arr = [];
        $sms_config = tpCache('sms');
        foreach ($sms_config as $key => $val) {
            $sms_arr[$key] = $val;
        }
        if (3 == $sms_type) {
            foreach (['sms_smsbao_user','sms_smsbao_apikey'as $key => $val) {
                if (isset($sms_arr[$val]) && empty($sms_arr[$val])) {
                    $is_conf = 0;
                }
            }
        else if (2 == $sms_type) {
            foreach (['sms_appkey_tx','sms_appid_tx'as $key => $val) {
                if (isset($sms_arr[$val]) && empty($sms_arr[$val])) {
                    $is_conf = 0;
                }
            }
        else {
            foreach (['sms_appkey','sms_secretkey'as $key => $val) {
                if (isset($sms_arr[$val]) && empty($sms_arr[$val])) {
                    $is_conf = 0;
                }
            }
        }
        $this->assign('is_conf'$is_conf);
 
        $shop_open = getUsersConfigData('shop.shop_open');
        $this->assign('shop_open'$shop_open);
 
        // ToSms短信通知插件內(nèi)置代碼 start
        $show_sms_tpl_code = true;
        if (file_exists('./weapp/ToSms/model/ToSmsModel.php')) {
            $toSmsModel new \weapp\ToSms\model\ToSmsModel;
            $show_sms_tpl_code $toSmsModel->admin_system_sms_tpl($sms_type'show_sms_tpl_code');
        }
        if (3 == $sms_type) {
           $show_sms_tpl_code = false;
        }
        $this->assign('show_sms_tpl_code'$show_sms_tpl_code);
        // ToSms短信通知插件內(nèi)置代碼 end
 
        return $this->fetch();
    }

接著打開項目:application\common\logic\SmsLogic.php文件,增加短信寶核心發(fā)送代碼

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/**
     * 發(fā)送短信(短信寶)
     * @param $mobile  手機(jī)號碼
     * @param $code    驗證碼
     * @return bool    短信發(fā)送成功返回true失敗返回false
     */
    private function sendSmsBySmsbao($mobile$smsSign$smsParam$templateCode,$nationCode "86")
    {
        $statusStr array(
                    "0" => "短信發(fā)送成功",
                    "-1" => "參數(shù)不全",
                    "-2" => "服務(wù)器空間不支持,請確認(rèn)支持curl或者fsocket,聯(lián)系您的空間商解決或者更換空間!",
                    "30" => "密碼錯誤",
                    "40" => "賬號不存在",
                    "41" => "余額不足",
                    "42" => "帳戶已過期",
                    "43" => "IP地址限制",
                    "50" => "內(nèi)容含有敏感詞"
                );
        $user     $this->config['sms_smsbao_user'];
        $apikey     $this->config['sms_smsbao_apikey'];
        $content     $smsParam['msg'];
 
        if (empty($user) || empty($apikey)) {
            return array('status' => -1, 'msg' => '請設(shè)置短信平臺信息');
        }
        if (is_array($mobile)) {
            $mobile = implode(","$mobile);
        }
        $content=urlencode('【' $smsSign '】' $content);
        if (86 == $nationCode) {
        }else{
            $sender_arr explode(','$mobile);
            foreach ($sender_arr as $key => $val) {
                $val = trim($val);
                if (empty($val)) {
                    unset($sender_arr[$key]);
                    continue;
                }
                $sender_arr[$key] = '+'.$nationCode.$val;
            }
            $sender = implode(','$sender_arr);
            $mobile=urlencode($sender);
        }
         
        if (function_exists('file_get_contents')) {
            $res file_get_contents($url);
        }else {
            $ch = curl_init();
            $timeout = 5;
            curl_setopt($ch, CURLOPT_URL, $url);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
            $res = curl_exec($ch);
            curl_close($ch);
        }
         
        $message $statusStr[$res];
        if($res == 0){
           return array('status' => 1, 'msg' => $message);
        }else{
            return array('status' => -1, 'msg' => $message);
        }
    }

好了經(jīng)過以上的添加,短信寶的短信平臺已經(jīng)替換成功了,可以正常使用了

報備一下短信寶的VIP模板,這樣就可以走短信寶的優(yōu)質(zhì)通道了,即便遇到敏感文字我們都不會人工審核,短信內(nèi)容3~5秒就可送達(dá)。

另外:我們已經(jīng)開發(fā)好完整的EyouCMS系統(tǒng)短信寶插件,點擊此鏈接 下載及查看安裝流程。

開源插件

最新更新

電商類

CMS類

微信類

文章標(biāo)簽
精品深夜福利视频,日本中文字幕不卡,久久久久国产,av综合电影网站
好看的亚洲午夜视频在线| 国产精品欧美在线观看| 午夜av一区| 国产精品91一区二区三区| 亚洲女同中文字幕| 美女久久久久| 亚洲一区日韩在线| 亚洲色图综合| 午夜精品福利影院| 91成人在线| 精品欠久久久中文字幕加勒比| 国产成人1区| 欧美aa在线观看| 亚洲午夜久久久久久尤物| 日韩午夜高潮| 日产欧产美韩系列久久99| 欧美永久精品| 国产精品日本一区二区三区在线 | 国产精品99一区二区三区| 免费一二一二在线视频| 亚洲精品网址| 日韩欧美中文字幕一区二区三区| 国产精品三级| 色偷偷色偷偷色偷偷在线视频| 久久一级电影| 亚州精品视频| 美日韩一区二区三区| 成午夜精品一区二区三区软件| 正在播放日韩精品| 精品欧美视频| 精品九九久久| 日韩免费小视频| 欧美精品激情| 亚洲日本久久| 高清日韩中文字幕| 99在线|亚洲一区二区| 日韩不卡免费视频| 亚洲最新无码中文字幕久久| 国产亚洲午夜| 国产精品s色| 蜜桃成人精品| 日韩在线a电影| 麻豆精品新av中文字幕| 伊人久久av| 亚洲精品护士| 亚洲精品88| 日本综合精品一区| 秋霞影院一区二区三区| 亚洲啊v在线免费视频| 久久天堂av| 免费看的黄色欧美网站| 久久福利在线| 欧美1区2区3区| 国产乱码精品一区二区三区四区| 91精品一区二区三区综合| 91精品福利观看| 99久久婷婷| 国产亚洲一卡2卡3卡4卡新区| www在线观看黄色| 蜜桃视频一区二区三区| 精品少妇一区| 亚州av日韩av| 99久久精品费精品国产| 欧美日本二区| 欧美日韩少妇| 精品国产不卡| 男人的天堂久久精品| 欧美日韩视频免费观看| 久久gogo国模啪啪裸体| 日韩天堂av| 中国字幕a在线看韩国电影| 日韩精品免费视频人成| 99国产精品| 日产午夜精品一线二线三线| 亚洲精品观看| 亚洲少妇一区| 欧美日韩亚洲在线观看| 久久精品国产久精国产| 日韩精品1区2区3区| 久久青草久久| 欧美aⅴ一区二区三区视频| 蜜桃成人av| 福利视频一区| 亚洲精品动态| 欧美日韩国产一区二区三区不卡| 国内精品麻豆美女在线播放视频| 日韩三级精品| 欧美一级专区| av在线日韩| 精品国产乱码久久久久久樱花| 日韩1区2区3区| 蜜桃久久久久久| 国产亚洲精品自拍| 激情婷婷久久| 群体交乱之放荡娇妻一区二区| 国产一区精品福利| 美女精品久久| 久久不卡日韩美女| 国产欧美日韩一区二区三区在线| 亚洲另类视频| 蜜臀av一区二区三区| 黄色亚洲在线| 九九久久电影| 欧洲亚洲一区二区三区| 国产伊人久久| 国产中文字幕一区二区三区| 麻豆国产精品视频| 乱一区二区av| 精品视频97| 国产一区国产二区国产三区| 久久影院资源站| 久久国产欧美日韩精品| 中文字幕在线视频网站| 91亚洲无吗| 日韩极品在线观看| 亚洲精品日韩久久| 亚洲一区二区免费在线观看| 国产精品丝袜xxxxxxx| 久久中文字幕二区| 久久精品高清| 午夜国产精品视频| 国产精品美女久久久| 久久亚洲国产精品一区二区| 天堂av在线一区| 亚洲一区二区三区四区五区午夜| 欧美午夜不卡| 蜜臀av国产精品久久久久| 蜜桃视频在线观看一区| 日韩视频1区| 国产亚洲欧美日韩在线观看一区二区| 欧美一级网址| 国产激情欧美| 成人国产综合| 97精品在线| 91精品一区二区三区综合| 九九综合九九| 亚洲在线电影| 日本va欧美va精品| 欧美黄页在线免费观看| 精品免费av| 亚洲成a人片| 午夜久久久久| 婷婷视频一区二区三区| 国产suv精品一区二区四区视频| 日本亚洲视频在线| 亚洲人www| 国产精品xxx在线观看| 里番精品3d一二三区| 国产精品久久观看| 成人污污视频| 伊人精品一区| 综合五月婷婷| 久久av导航| 久久女人天堂| 国产精品99一区二区| 性欧美精品高清| 国产日韩亚洲| 中文一区一区三区高中清不卡免费| 久久蜜桃av| 亚洲2区在线| 日韩av片子| 在线亚洲激情| 国产精品香蕉| 久久久久亚洲| 丝袜脚交一区二区| 你懂的网址国产 欧美| 久久狠狠婷婷| 日韩一区二区三区免费视频| 精品国产乱码久久久久久樱花| 91精品久久久久久久久久不卡| 视频一区视频二区中文字幕| 欧美黄页在线免费观看| 91九色精品| 国产日韩一区二区三区在线 | 九九精品调教| 日韩视频不卡| 日韩 欧美一区二区三区| 国产aa精品| 久久亚洲色图| 久久中文字幕一区二区| 黄色日韩在线| 美女毛片一区二区三区四区最新中文字幕亚洲 | 亚洲综合不卡| 精品久久免费| 蜜臀av一区二区三区| 精品高清久久| 亚洲1区在线| 免费高潮视频95在线观看网站| 蜜桃免费网站一区二区三区| 国产成人黄色| 无码日韩精品一区二区免费| 国产亚洲一区二区手机在线观看 | 亚洲91网站| 欧美国产一级| 亚洲精品国产日韩| 欧美午夜精品一区二区三区电影| 久久国产三级精品| 亚洲欧美视频一区二区三区| 久久不见久久见中文字幕免费| 影音国产精品|