91成人在线播放_欧美一区二区视频在线观看_91精品国产高清久久久久久_国产精品久久亚洲不卡4k岛国


待發短信

在線客服
產品支持 短信寶客服
合作渠道 渠道合作
服務咨詢

4001-021-502

工作時間

9:00-21:00

ECJia到家V1.37.0新增短信寶短信接口

ECJia移動商城系統(EC+)是一款基于移動互聯網的商城應用服務產品,擁有執行效率高、上手輕松、管理便捷等一系列優點。今天小編為大家講解一下ECJIA1.37.0這個版本的短信插件該如何開發,短信接口使用的是我們短信寶短信群發平臺,我們短信寶短信群發平臺極其穩定,而且短信發送速度相當快捷,驗證碼和訂單通知在3~5秒就能收到,用戶體驗非常好,注冊就送測試短信。

1:打開項目:\vendor\royalcms\sms\config\sms.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
<?php
 
 
return [
    'default' => env('SMS_DEFAULT''smsbao'),
 
 
    'fallback' => env('SMS_FALLBACK'),
 
 
    'signName' => env('SMS_SIGNNAME'),
 
 
    'agents' => [
        'ihuyi' => [
            'credentials' => [
                'appKey' => env('IHUYI_APPKEY'),
                'appSecret' => env('IHUIYI_APPSECRET')
            ],
            'executableFile' => 'IHuYiAgent',
        ],
         'smsbao' => [
            'credentials' => [
                'appKey' => env('SMSBAO_APPKEY'),
                'appSecret' => env('SMSBAO_APPSECRET'),
                'appsign' => env('SMSBAO_APPSIGN')
            ],
            'executableFile' => 'SMSbao',
        ],
    ],
];

2:打開項目\vendor\royalcms\sms\Royalcms\Component\Sms\Agents\ 創建SMSbao.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
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
<?php
namespace Royalcms\Component\Sms\Agents;
 
use Royalcms\Component\Support\Arr;
use Royalcms\Component\Sms\Sms;
use Royalcms\Component\Sms\Contracts\SmsAgent;
use RC_Xml;
use RC_Error;
use Royalcms\Component\Sms\SendResponse;
use Royalcms\Component\Sms\BalanceResponse;
 
 
class SMSbao extends Sms implements SmsAgent
{
    
const HOST      = 'http://api.smsbao.com/sms?';
   
    
    private $appKey;
    private $appSecret;
    private $appSign;
 
 
    private $statusStr = array(
        "0" => "短信發送成功",
        "-1" => "參數不全",
        "-2" => "服務器空間不支持,請確認支持curl或者fsocket,聯系您的空間商解決或者更換空間!",
        "30" => "密碼錯誤",
        "40" => "賬號不存在",
        "41" => "余額不足",
        "42" => "帳戶已過期",
        "43" => "IP地址限制",
        "50" => "內容含有敏感詞"
    );
    
    public function __construct($config)
    {
        $this->config = $config;
        $this->transformConfig();
    }
    
    public function transformConfig()
    {
        $credentials = Arr::pull($this->config, 'credentials');
        $this->appKey = Arr::pull($credentials, 'appKey');
        $this->appSecret = Arr::pull($credentials, 'appSecret');
        $this->appSign = Arr::pull($credentials, 'appsign');
    }
    
    protected function authParams()
    {
        return [
            'u'   => $this->appKey,
            'p'  => $this->appSecret,
            'k' =>  $this->appSign
        ];
    }
    
    /**
     * 發送信息
     
     * @see \Royalcms\Component\Sms\Contracts\SmsAgent::send()
     */
    public function send($mobile)
    {
        $url = self::HOST.'u='.$this->appKey.'&p='.md5($this->appSecret).'&m='.$mobile.'&c=【'.$this->appSign.'】'.$this->content;
        $ret = file_get_contents($url);
        return $this->transformerResponse('send',$ret);
 
 
    }
    
    /**
     * 查詢賬戶余額
     */
    public function balance()
    {
        $url = 'http://api.smsbao.com/query?u='.$this->appKey.'&p='.md5($this->appSecret);
 
 
 
 
        $ret = file_get_contents($url);
        $rest = explode(",",$ret);
        $res['data']['num'] = $rest['1'];
        return $this->transformerResponse('balance',$res);
        
        
        
    }
    
    /**
     * 轉換返回的信息處理
     * @param array $response
     * @return array $result
     * @return int $result[].code 返回0則成功,返回其它則錯誤
     * @return string $result[].msg 返回消息
     * @return string $result[].raw 接口返回的原生信息
     * @return array $result[].data 數據信息
     */
    public function transformerResponse($type,$response)
    {
        $result_arr = $this->statusStr;
        if($type=='send'){
            $result=new SendResponse();
            $result->setMsgid($response);
            $result->setCode($response);
            $result->setDescription($result_arr[$response]);
            $result->getDescription($result_arr[$response]);
        }else{
            $result=new BalanceResponse();
            $result->setBalance($response['data']['num']);
            $result->setCode($response);
            $result->setDescription($result_arr[$response]);
            $result->getDescription($result_arr[$response]);
        }
        
        return $result;
    }
 

3:接著在項目\content\plugins\創建文件:sms_smsbao\config.php

?
1
2
3
4
5
6
7
8
9
10
11
12
<?php
return array(
    'sms_code'      => 'sms_smsbao',
    
    'check_balance' => true,
    
    'forms' => array(
       array('name' => 'app_key',           'type' => 'text',       'value' => ''),
       array('name' => 'app_secret',        'type' => 'text',       'value' => ''),
        array('name' => 'app_sign',        'type' => 'text',       'value' => '')
    ),
);

4:接著在項目\content\plugins\sms_smsbao\ 創建sms_smsbao.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
 
 
defined('IN_ECJIA') or exit('No permission resources.');
 
 
use Ecjia\App\Sms\SmsAbstract;
 
 
class sms_smsbao extends SmsAbstract
{
    
    public function setConfig(array $config)
    {
        parent::setConfig($config);
        
        $this->setAgentConfig();
        
        $this->agent = royalcms('sms')->driver('smsbao');
    }
    
    public function setAgentConfig()
    {
        RC_Config::set('sms::sms.agents.smsbao.credentials', [
            'appKey' => $this->config['app_key'],
            'appSecret' => $this->config['app_secret'],
            'appsign' => $this->config['app_sign']
        ]);
    }
    
    
    /**
     * 獲取插件代號
     *  
     * @see \Ecjia\System\Plugin\PluginInterface::getCode()
     */
    public function getCode()
    {
        return $this->loadConfig('sms_code');
    }
 
 
    /** 
     * 加載配置文件
     
     * @see \Ecjia\System\Plugin\PluginInterface::loadConfig()
     */
    public function loadConfig($key = null, $default null)
    {        
        return $this->loadPluginData(RC_Plugin::plugin_dir_path(__FILE__) . 'config.php', $key, $default);
    }
 
 
    /** 
     * 加載語言包
     
     * @see \Ecjia\System\Plugin\PluginInterface::loadLanguage()
     */
    public function loadLanguage($key = null, $default null)
    {
        $locale = RC_Config::get('system.locale');
        return $this->loadPluginData(RC_Plugin::plugin_dir_path(__FILE__) . '/languages/'.$locale.'/plugin.lang.php', $key, $default);
    }
}

5:接著在項目\content\plugins\sms_smsbao\創建sms_smsbao.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
46
47
48
49
50
51
52
<?php
 
 
/*
Plugin Name: 短信寶短信
Description: 使用短信寶短信渠道,發送驗證碼短信、訂單通知等。
Author: ECJIA TEAM
Version: 1.0.0
Author URI: http://www.ecjia.com/
Plugin App: sms
*/
defined('IN_ECJIA') or exit('No permission resources.');
class plugin_sms_smsbao {
 
 
    public static function install() {
        $config = include(RC_Plugin::plugin_dir_path(__FILE__) . 'config.php');
        $param = array('file' => __FILE__, 'config' => $config);
        return RC_Api::api('sms''plugin_install', $param);
    }
 
 
 
 
    public static function uninstall() {
        $config = include(RC_Plugin::plugin_dir_path(__FILE__) . 'config.php');
        $param = array('file' => __FILE__, 'config' => $config);
        return RC_Api::api('sms''plugin_uninstall', $param);
    }
 
 
    public static function royalcms_sms_agent_filter($factories) {
        require_once RC_Plugin::plugin_dir_path(__FILE__) . 'SMSbao.php';
        
        $factories['smsbao'] = 'SMSbao';
        return $factories;
    }
 
 
}
 
 
Ecjia_PluginManager::extend('sms_smsbao'function() {
    require_once RC_Plugin::plugin_dir_path(__FILE__) . 'sms_smsbao.class.php';
    return new sms_smsbao();
});
 
 
RC_Plugin::register_activation_hook(__FILE__, array('plugin_sms_smsbao''install'));
RC_Plugin::register_deactivation_hook(__FILE__, array('plugin_sms_smsbao''uninstall'));
RC_Hook::add_filter('royalcms_sms_agent_filter', array( 'plugin_sms_smsbao''royalcms_sms_agent_filter' ));

6:接著在項目\content\plugins\sms_smsbao\創建SMSbao.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
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
<?php
 
 
use Royalcms\Component\Support\Arr;
use Royalcms\Component\Sms\Sms;
use Royalcms\Component\Sms\Contracts\SmsAgent;
use RC_Xml;
use RC_Error;
use Royalcms\Component\Sms\SendResponse;
use Royalcms\Component\Sms\BalanceResponse;
 
 
class SMSbao extends Sms implements SmsAgent
{
    
    const HOST      = 'http://api.smsbao.com/sms?';
   
    
    private $appKey;
    private $appSecret;
    private $appSign;
 
 
    private $statusStr = array(
        "0" => "短信發送成功",
        "-1" => "參數不全",
        "-2" => "服務器空間不支持,請確認支持curl或者fsocket,聯系您的空間商解決或者更換空間!",
        "30" => "密碼錯誤",
        "40" => "賬號不存在",
        "41" => "余額不足",
        "42" => "帳戶已過期",
        "43" => "IP地址限制",
        "50" => "內容含有敏感詞"
    );
    
    public function __construct($config)
    {
        $this->config = $config;
        $this->transformConfig();
    }
    
    public function transformConfig()
    {
        $credentials = Arr::pull($this->config, 'credentials');
        $this->appKey = Arr::pull($credentials, 'appKey');
        $this->appSecret = Arr::pull($credentials, 'appSecret');
        $this->appSign = Arr::pull($credentials, 'appsign');
    }
    
    protected function authParams()
    {
        return [
            'u'   => $this->appKey,
            'p'  => $this->appSecret,
            'k' =>  $this->appSign
        ];
    }
    
    /**
     * 發送信息
     
     * @see \Royalcms\Component\Sms\Contracts\SmsAgent::send()
     */
    public function send($mobile)
    {
        $url = self::HOST.'u='.$this->appKey.'&p='.md5($this->appSecret).'&m='.$mobile.'&c=【'.$this->appSign.'】'.$this->content;
        $ret = file_get_contents($url);
        return $this->transformerResponse('send',$ret);
 
 
    }
    
    /**
     * 查詢賬戶余額
     */
    public function balance()
    {
        $url = 'http://api.smsbao.com/query?u='.$this->appKey.'&p='.md5($this->appSecret);
 
 
 
 
        $ret = file_get_contents($url);
        $rest = explode(",",$ret);
        $res['data']['num'] = $rest['1'];
        return $this->transformerResponse('balance',$res);
        
        
        
    }
    
    /**
     * 轉換返回的信息處理
     * @param array $response
     * @return array $result
     * @return int $result[].code 返回0則成功,返回其它則錯誤
     * @return string $result[].msg 返回消息
     * @return string $result[].raw 接口返回的原生信息
     * @return array $result[].data 數據信息
     */
    public function transformerResponse($type,$response)
    {
        $result_arr = $this->statusStr;
        if($type=='send'){
            $result=new SendResponse();
            $result->setMsgid($response);
            $result->setCode($response);
            $result->setDescription($result_arr[$response]);
            $result->getDescription($result_arr[$response]);
        }else{
            $result=new BalanceResponse();
            $result->setBalance($response['data']['num']);
            $result->setCode($response);
            $result->setDescription($result_arr[$response]);
            $result->getDescription($result_arr[$response]);
        }
        
        return $result;
    }
  

7:最后在項目\content\plugins\sms_smsbao\創建新的文件夾languages\zh_CN\,名為:plugin.lang.php文件

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php
 
 
defined('IN_ECJIA') or exit('No permission resources.');
 
 
/**
 * ECJIA 程序語言包
 */
 
 
return array(
    'app_key'  => '短信寶帳號:',
    'app_secret'   => '短信寶密碼:',
    'app_sign'     => '短信簽名:'
);

經過上面的替換,短信寶的短信平臺已經替換成功了,可以正常使用了。進行測試發送:

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

另外:我們已經開發好完整的ECJIA1.37.0商城系統短信寶插件,點擊此鏈接 下載及查看安裝流程。

開源插件

最新更新

電商類

CMS類

微信類

文章標簽
91成人在线播放_欧美一区二区视频在线观看_91精品国产高清久久久久久_国产精品久久亚洲不卡4k岛国
国产亚洲一区二区在线观看| 激情小说欧美图片| 欧美色综合天天久久综合精品| 亚洲国产精品久久一线不卡| 91精品国产91久久综合桃花| 国产乱码字幕精品高清av| 国产精品婷婷午夜在线观看| 欧美三级电影网站| 国产成人免费视| 偷拍日韩校园综合在线| 国产亚洲女人久久久久毛片| 欧美色综合久久| 成人永久免费视频| 日韩国产欧美视频| 亚洲精品乱码久久久久| 欧美精品一区二区三区在线| 欧美亚洲动漫制服丝袜| 国产精品1区二区.| 日韩一区欧美二区| 亚洲欧美日韩小说| 国产欧美日韩卡一| 日韩一区二区三区电影| 欧洲激情一区二区| 成人精品一区二区三区中文字幕| 三级影片在线观看欧美日韩一区二区| 中文字幕二三区不卡| 欧美一区二区福利在线| 在线欧美日韩精品| 成人午夜av在线| 国产一级精品在线| 蜜臀av国产精品久久久久| 一区二区三区中文在线| 国产精品视频一二三区| 欧美大胆一级视频| 91精品一区二区三区在线观看| 91在线无精精品入口| 国产成人精品免费一区二区| 免费av网站大全久久| 午夜国产精品一区| 亚洲午夜激情网站| 一区二区三区在线观看欧美| 中文字幕在线观看一区| 久久久精品2019中文字幕之3| 欧美性受极品xxxx喷水| 国产91在线看| 极品少妇xxxx精品少妇偷拍| 日韩成人免费在线| 日韩精品91亚洲二区在线观看 | 亚洲国产综合视频在线观看| ...av二区三区久久精品| 中文子幕无线码一区tr| 欧美高清在线一区二区| 国产人成一区二区三区影院| 久久精品欧美日韩| 国产人久久人人人人爽| 国产三级精品视频| 国产亚洲婷婷免费| 欧美国产精品中文字幕| 国产精品免费久久久久| 中文字幕一区二区日韩精品绯色| 中文字幕av不卡| 亚洲视频免费在线| 亚洲伊人色欲综合网| 五月婷婷另类国产| 日本不卡视频在线观看| 精品一区二区三区免费| 国产福利91精品一区二区三区| 国产成人一级电影| 91在线观看视频| 日本高清无吗v一区| 欧美日韩五月天| 日韩亚洲电影在线| 国产亚洲美州欧州综合国| 国产精品视频一二三区 | 亚洲精品国产无天堂网2021| 一区二区三区四区亚洲| 视频精品一区二区| 国产精品一区二区在线看| 94-欧美-setu| 欧美放荡的少妇| 久久夜色精品国产欧美乱极品| 中文乱码免费一区二区| 亚洲女人的天堂| 日本在线不卡视频| 国产精品77777竹菊影视小说| 成人18视频日本| 欧美日韩国产bt| 久久精品免费在线观看| 亚洲精品日韩综合观看成人91| 午夜精品久久久久影视| 国产精品自在欧美一区| 在线精品国精品国产尤物884a| 91精品婷婷国产综合久久| 久久精品网站免费观看| 亚洲午夜精品一区二区三区他趣| 久久99精品久久只有精品| 91在线你懂得| 欧美成人vr18sexvr| 亚洲精品国产一区二区精华液 | 亚洲高清免费在线| 国产精品系列在线观看| 欧美日韩精品一区二区三区| 久久精品夜色噜噜亚洲a∨| 香蕉成人啪国产精品视频综合网 | 久久综合九色综合欧美就去吻| 亚洲精品亚洲人成人网在线播放| 裸体歌舞表演一区二区| 日本精品视频一区二区| 久久久久久久综合色一本| 91看片淫黄大片一级| 狠狠色综合播放一区二区| 欧美网站一区二区| 欧美国产精品一区二区| 奇米888四色在线精品| 一本色道综合亚洲| 国产偷国产偷亚洲高清人白洁| 91精品国产综合久久福利软件 | 日韩精品中文字幕在线一区| 伊人婷婷欧美激情| 粗大黑人巨茎大战欧美成人| 日韩一区二区视频| 亚洲电影一级片| 色综合咪咪久久| 日本一区二区成人在线| 久久国产精品露脸对白| 3751色影院一区二区三区| 亚洲精品写真福利| 不卡的电影网站| 中文字幕不卡一区| 精品一区二区三区在线播放 | 久久久久综合网| 蜜桃av一区二区在线观看| 欧美午夜精品久久久久久超碰| 国产精品久久久一本精品| 国产传媒欧美日韩成人| 精品国产三级a在线观看| 麻豆传媒一区二区三区| 欧美疯狂做受xxxx富婆| 日韩有码一区二区三区| 欧美高清视频在线高清观看mv色露露十八| 亚洲精品伦理在线| 99久久99久久久精品齐齐| 国产精品乱人伦| 成人免费高清在线观看| 国产精品久久久久久亚洲伦| 成年人午夜久久久| 1区2区3区精品视频| 99精品欧美一区二区三区小说 | 中文字幕永久在线不卡| 91视频在线看| 亚洲精品国产一区二区精华液 | 日韩一区精品字幕| 欧美一级免费大片| 精品一区二区三区不卡 | 久草精品在线观看| 久久久久亚洲蜜桃| 成人激情开心网| 亚洲欧洲日产国产综合网| 91年精品国产| 亚洲高清免费观看| 日韩欧美国产小视频| 国产在线播放一区| 国产精品久久久久久亚洲伦| 91蝌蚪porny| 日产国产高清一区二区三区| 精品福利在线导航| 成人性生交大片免费| 亚洲色大成网站www久久九九| 欧美性视频一区二区三区| 日韩精品欧美精品| 久久免费的精品国产v∧| 99综合影院在线| 天天色综合天天| 精品国产伦理网| 91亚洲精品久久久蜜桃| 午夜精品成人在线| 久久久久九九视频| 91国偷自产一区二区三区观看 | 另类小说欧美激情| 成人动漫在线一区| 欧美欧美欧美欧美首页| 九色综合狠狠综合久久| 国产精品国模大尺度视频| 色久综合一二码| 老司机精品视频在线| 国产精品国产三级国产三级人妇| 欧美一a一片一级一片| 国产原创一区二区| 亚洲一区二区视频| 久久精品一区四区| 欧美亚洲国产一卡| 国产精品一区一区三区| 亚洲成人精品在线观看| 经典一区二区三区| 欧洲精品一区二区| 欧美大胆人体bbbb| 欧美一区二区在线免费观看| 亚洲国产精品高清| 蜜臀国产一区二区三区在线播放 | 国产精品资源在线观看|