ZKEYS業務管理系統通過提供完善的平臺來管理包括計算、網絡、存儲在內的各項資源,其功能模塊涵蓋了云服務器、虛擬主機、托管等業務的在線彈性購買及秒級開通交付; 平臺具有安裝簡單、維護輕松、成本低廉、業務功能齊全等特點,支持一鍵安裝Linux及Windows等多種環境,只需數十分鐘即可輕松的搭建。小編對它還是很了解的,今天小編就以新增短信接口為例,給大家講解一下如何進行二次開發,使用的短信接口是我們短信寶短信群發平臺的短信接口,我們短信寶短信群發平臺的接口非常穩定,發送速度快,注冊就送測試短信,推薦大家使用。
1:首先打開項目:\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" >注:為確保正常發送短信驗證碼,請正確填寫短信寶的短信通道信息!</span> </td> </tr> <tr> <th>短信寶賬號:</th> <td> <input type= "text" name= "smgApiId" class= "input input-long" value= "{$smg.smgApiId}" />填寫您的短信寶用戶名 </td> </tr> <tr> <th>短信寶密碼:</th> <td> <input type= "password" name= "smgApiKey" class= "input input-long" value= "{$smg.smgApiKey}" /> 填寫您的短信寶密碼 <span class= "row-title" >注:留空則不修改</span> </td> </tr> <tr> <th>短信寶簽名:</th> <td><input type= "text" name= "smgSignatureMd" class= "input input-long" value= "{$smg.smgSignatureMd}" />填寫您的短信寶簽名</td> </tr> </tbody> </table> </div> |
2:打開項目:\libs\Niaoyun\Common\Sms\EnInfo.class.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
public function send($mobile, $content, $id = null ) { $smsapi = $ this ->config[ 'url' ]; $user = $ this ->config[ 'apiId' ]; //短信平臺帳號 $pass = md5($ this ->config[ 'apiKey' ]); //短信平臺密碼 $content=$ this ->config[ 'signature' ].$content; //要發送的短信內容 $phone = $mobile; //要發送短信的手機號碼 $sendurl = $smsapi. "u=" .$user. "&p=" .$pass. "&m=" .$phone. "&c=" .urlencode($content); $result =file_get_contents($sendurl) ; $statusStr = array( "0" => "短信發送成功" , "-1" => "參數不全" , "-2" => "服務器空間不支持,請確認支持curl或者fsocket,聯系您的空間商解決或者更換空間!" , "30" => "密碼錯誤" , "40" => "賬號不存在" , "41" => "余額不足" , "42" => "帳戶已過期" , "43" => "IP地址限制" , "50" => "內容含有敏感詞" ); if (is_numeric($result) && $result > 0) { $ this ->error = $result . $statusStr[$result]; return false ; } return true ; // $this->setApi('mt'); // $this->setMobile($mobile); // $this->setContent($content); // $this->setMessageId($id); // id 由控制類生成 // $this->setUrl($this->config['url'] . '/' . $this->api); // $this->setParams(); // $this->setHeaders(null); // // $result = $this->sendPost($this->url, $this->params, $this->headers); // // return $this->processSendResult($result); } |
打開項目:\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短信' , ], /** * 以下為自己開發短信接口配置demo * 數字序號為通道序號,系統默認的為1,2通道,3以上可自行設置 * 為了系統的穩定,請勿隨意更改系統默認的通道信息。 * * ```php * 3 => [ * 'className' => 'Others', // 短信接口實現的類名,需與實現的發送類一致 * 'channelName' => '其他短信通道', // 短信通道名稱,可以為中文,用以展示 * ], * ``` */ ]; |
好了經過以上的添加,短信寶小鳥云zkeys_4.4.3系統增加手機驗證就已經安裝成功,可以正常使用了
報備一下短信寶的VIP模板,這樣就可以走短信寶的優質通道了,即便遇到敏感文字我們都不會人工審核,短信內容3~5秒就可送達。
另外:我們已經開發好完整的小鳥云zkeys_4.4.3系統短信寶插件,點擊此鏈接 下載及查看安裝流程。
最新更新
電商類
CMS類
微信類