ZKEYS業(yè)務(wù)管理系統(tǒng)通過(guò)提供完善的平臺(tái)來(lái)管理包括計(jì)算、網(wǎng)絡(luò)、存儲(chǔ)在內(nèi)的各項(xiàng)資源,其功能模塊涵蓋了云服務(wù)器、虛擬主機(jī)、托管等業(yè)務(wù)的在線彈性購(gòu)買(mǎi)及秒級(jí)開(kāi)通交付; 平臺(tái)具有安裝簡(jiǎn)單、維護(hù)輕松、成本低廉、業(yè)務(wù)功能齊全等特點(diǎn),支持一鍵安裝Linux及Windows等多種環(huán)境,只需數(shù)十分鐘即可輕松的搭建。小編對(duì)它還是很了解的,今天小編就以新增短信接口為例,給大家講解一下如何進(jìn)行二次開(kāi)發(fā),使用的短信接口是我們短信寶短信群發(fā)平臺(tái)的短信接口,我們短信寶短信群發(fā)平臺(tái)的接口非常穩(wěn)定,發(fā)送速度快,注冊(cè)就送測(cè)試短信,推薦大家使用。
1:首先打開(kāi)項(xiàng)目:\template\Admin\Zkeys\PC\Page\Setting\basic.html 替換為短信寶通道
|
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
|
<div class="content-block"> <div class="content-block-title"> 短信通道一 <span class="show-tip" data-query="zkeys-setting-smg-smgOne"></span> </div> <table class="inner-table edit-table"> <tbody> <tr> <th>通道:</th> <td> 短信寶 http://www.gjrencai.com <span class="row-title">注:為確保正常發(fā)送短信驗(yàn)證碼,請(qǐng)正確填寫(xiě)短信寶的短信通道信息!</span> </td> </tr> <tr> <th>短信寶賬號(hào):</th> <td> <input type="text" name="smgApiId" class="input input-long" value="{$smg.smgApiId}"/>填寫(xiě)您的短信寶用戶名 </td> </tr> <tr> <th>短信寶密碼:</th> <td> <input type="password" name="smgApiKey" class="input input-long" value="{$smg.smgApiKey}"/> 填寫(xiě)您的短信寶密碼 <span class="row-title">注:留空則不修改</span> </td> </tr> <tr> <th>短信寶簽名:</th> <td><input type="text" name="smgSignatureMd" class="input input-long" value="{$smg.smgSignatureMd}"/>填寫(xiě)您的短信寶簽名</td> </tr> </tbody> </table> </div> |
2:打開(kāi)項(xiàng)目:\libs\Niaoyun\Common\Sms\EnInfo.class.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
|
public function send($mobile, $content, $id = null, $type =2, $params = [],$handleResult = true) { $smsapi = $this->config['url']; $user = $this->config['apiId']; //短信平臺(tái)帳號(hào) $pass = md5($this->config['apiKey']); //短信平臺(tái)密碼 $content=$this->config['signature'].$content;//要發(fā)送的短信內(nèi)容 $phone = $mobile;//要發(fā)送短信的手機(jī)號(hào)碼 $sendurl = $smsapi."u=".$user."&p=".$pass."&m=".$phone."&c=".urlencode($content); $result =file_get_contents($sendurl) ; $statusStr = array( "0" => "短信發(fā)送成功", "-1" => "參數(shù)不全", "-2" => "服務(wù)器空間不支持,請(qǐng)確認(rèn)支持curl或者fsocket,聯(lián)系您的空間商解決或者更換空間!", "30" => "密碼錯(cuò)誤", "40" => "賬號(hào)不存在", "41" => "余額不足", "42" => "帳戶已過(guò)期", "43" => "IP地址限制", "50" => "內(nèi)容含有敏感詞" ); if (is_numeric($result) && $result > 0) { $this->error = $result . $statusStr[$result]; return false; } return true; } |
打開(kāi)項(xiàng)目:\config\smsConfig.php 修改下短信名稱
|
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
|
return [ 1 => [ 'className' => 'EnInfo', 'channelName' => '短信寶', ], 2 => [ 'className' => 'Office', 'channelName' => '第二辦公室短信', ], 3 => [ 'className' => 'ZkeysSms', 'channelName' => 'ZKEYS短信', ], /** * 以下為自己開(kāi)發(fā)短信接口配置demo * 數(shù)字序號(hào)為通道序號(hào),系統(tǒng)默認(rèn)的為1,2通道,3以上可自行設(shè)置 * 為了系統(tǒng)的穩(wěn)定,請(qǐng)勿隨意更改系統(tǒng)默認(rèn)的通道信息。 * * ```php * 3 => [ * 'className' => 'Others', // 短信接口實(shí)現(xiàn)的類名,需與實(shí)現(xiàn)的發(fā)送類一致 * 'channelName' => '其他短信通道', // 短信通道名稱,可以為中文,用以展示 * ], * ``` */]; |
好了經(jīng)過(guò)以上的添加,短信寶小鳥(niǎo)云zkeys_5.1.8系統(tǒng)增加手機(jī)驗(yàn)證就已經(jīng)安裝成功,可以正常使用了

報(bào)備一下短信寶的VIP模板,這樣就可以走短信寶的優(yōu)質(zhì)通道了,即便遇到敏感文字我們都不會(huì)人工審核,短信內(nèi)容3~5秒就可送達(dá)。
另外:我們已經(jīng)開(kāi)發(fā)好完整的小鳥(niǎo)云zkeys_5.1.8系統(tǒng)短信寶插件,點(diǎn)擊此鏈接 下載及查看安裝流程。
最新更新
電商類
CMS類
微信類