phpyun人才系統(tǒng)在招聘人才系統(tǒng)中也是佼佼者,最近小編知道了php云人才系統(tǒng)更新到7.0版本了,之前的短信插件也無法使用了,小編也整理了一下,下面帶著大家一起進(jìn)行新版本的替換。我們使用的短信接口是我們短信寶短信群發(fā)平臺(tái)的短信接口,我們短信寶短信平臺(tái)十分穩(wěn)定,發(fā)送速度快,注冊(cè)就送測(cè)試短信,推薦大家使用。
1:打開項(xiàng)目:app\template\admin\tool\message\component\messageshow.vue 修改35行左右 新增短信寶相關(guān)配置
|
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
|
<tr> <td> <div class="TableTite">短信寶賬號(hào)</div> </td> <td> <div class="TableInpt"> <el-input placeholder="請(qǐng)輸入短信寶賬號(hào)" v-model="sy_msg_appkey"></el-input> </div> </td> <td> <div class="TableShuom"> <span><a href=" </span> </div> </td> </tr><tr> <td> <div class="TableTite">短信寶密碼</div> </td> <td> <div class="TableInpt"> <el-input placeholder="請(qǐng)輸入短信寶密碼" v-model="sy_msg_appsecret"></el-input> </div> </td> <td> <div class="TableShuom"> <span> </span> </div> </td></tr><tr> <td> <div class="TableTite">單IP每日最大發(fā)送</div> </td> <td> <div class="TableInpt"> <el-input placeholder="請(qǐng)輸入內(nèi)容" v-model="ip_msgnum" @input="inputIntNumber($event, 'ip_msgnum')"> <template slot="append">條</template> </el-input> </div> </td> <td> <div class="TableShuom"> <span> </span> </div> </td></tr> |
2:打開項(xiàng)目:admin\model\tool\messageset.class.php 增加查詢短信接口 大概第8行
|
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
|
function index_action(){ $msgnum = $businessnum = $khnum = 0; if (!empty($this->config['sy_msg_appkey']) && !empty($this->config['sy_msg_appsecret'])) { //短信檢測(cè) $url .= '?u=' . $this->config['sy_msg_appkey'] . '&p=' . md5($this->config['sy_msg_appsecret']); if (extension_loaded('curl')) { $return = CurlGet($url); } else if (function_exists('file_get_contents')) { $return = file_get_contents($url); } if ($return) { $msgInfo = explode(',', $return); if (is_array($msgInfo)){ $msgnum = $msgInfo[1]; } unset($return); } } if (!empty($this->config['sy_kh_appkey']) && !empty($this->config['sy_kh_appsecret'])) { //空號(hào)檢測(cè) $url .= '?appKey=' . $this->config['sy_kh_appkey'] . '&appSecret=' . $this->config['sy_kh_appsecret']; if (extension_loaded('curl')) { $return = CurlGet($url); } else if (function_exists('file_get_contents')) { $return = file_get_contents($url); } if ($return) { $msgInfo = json_decode($return, true); if ($msgInfo['code'] == '200') { $khnum = $msgInfo['num']; } unset($return); } } if (!empty($this->config['sy_tyc_appkey']) && !empty($this->config['sy_tyc_appsecret'])) { //天眼查檢測(cè) $url .= '?appKey=' . $this->config['sy_tyc_appkey'] . '&appSecret=' . $this->config['sy_tyc_appsecret']; if (extension_loaded('curl')) { $return = CurlGet($url); } else if (function_exists('file_get_contents')) { $return = file_get_contents($url); } if ($return) { $msgInfo = json_decode($return, true); if ($msgInfo['code'] == '200') { $businessnum = $msgInfo['num']; } } } $data = array( 'sy_msg_isopen' => $this->config['sy_msg_isopen'], 'sy_msg_appkey' => $this->config['sy_msg_appkey'], 'sy_msg_appsecret' => $this->config['sy_msg_appsecret'], 'ip_msgnum' => $this->config['ip_msgnum'], 'moblie_msgnum' => $this->config['moblie_msgnum'], 'cert_msgtime' => $this->config['cert_msgtime'], 'moblie_codetime' => $this->config['moblie_codetime'], 'sy_kh_isopen' => $this->config['sy_kh_isopen'], 'sy_kh_appkey' => $this->config['sy_kh_appkey'], 'sy_kh_appsecret' => $this->config['sy_kh_appsecret'], 'sy_kh_city' => $this->config['sy_kh_city'], 'sy_tyc_appkey' => $this->config['sy_tyc_appkey'], 'sy_tyc_appsecret' => $this->config['sy_tyc_appsecret'], 'rest_msgnum' => $msgnum, 'rest_businessnum' => $businessnum, 'rest_khnum' => $khnum, ); $this->render_json(0,'ok', $data); } |
3:打開項(xiàng)目:app\model\notice.model.php 修改短信發(fā)送函數(shù) 大概260行
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
function postSMS($type='msgsend',$data=''){ $sign = $this->config['sy_webname']; $data['content'] = str_replace(array(" "," ","\t","\n","\r"),array("","","","",""),$data['content']); $url.='?u='.$data['appkey'].'&p='.md5($data['appsecret']).'&m='.$data['phone'].'&c='.'【'.$sign.'】'.$data['content'];if (extension_loaded('curl')){ $file_contents = CurlGet($url); }else if(function_exists('file_get_contents')){ $file_contents = file_get_contents($url); } return [ 'code'=>$file_contents === '0' ? 200 : 501, 'message'=>$file_contents === '0' ? '發(fā)送成功' : '發(fā)送失敗' ]; } |
經(jīng)過上面的替換,短信寶的短信平臺(tái)已經(jīng)替換成功了,可以正常使用了。進(jìn)行測(cè)試發(fā)送:
報(bào)備一下短信寶的VIP模板,這樣就可以走短信寶的優(yōu)質(zhì)通道了,即便遇到敏感文字我們都不會(huì)人工審核,短信內(nèi)容3~5秒就可送達(dá)。
另外:我們已經(jīng)開發(fā)好完整的phpyun7.0系統(tǒng)短信寶插件,點(diǎn)擊此鏈接?下載及查看安裝流
最新更新
電商類
CMS類
微信類