<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                >[info] 快速導航 [TOC] ## 接口配置 在使用API之前你需要在后臺做一個簡單的API配置,如下圖: ![](https://box.kancloud.cn/e41db0b7698a94c70d6a8a1a47467fe4_1966x1264.png) ## 接口簽名(sign) >[info] 所有API接口調用必須要帶簽名參數sign > 簽名規則:md5(時間戳+API簽名秘鑰) > 時間戳格式:yyyy-MM-dd HH:mm:ss ## [list] 內容列表 >[info]接口地址:/cms/api/list 請求方式:GET/POST | 屬性名 | 類型 | 必須 | 默認 | 說明 | --- | --- | --- | --- | --- | | cid | int/var | 是 | 0 | 分類ID,cid和mid最少傳一個 | | mid | int/var | 是 | 0 | 模型ID,cid和mid最少傳一個 | | orderby | string | 否 | id desc | 結果排序 | | attr | string/array | 否 | | 擴展屬性 | | keyword | string/var | 否 | | 通過關鍵字搜索title | | limit | int | 否 | 20 | 返回結果條數 | | pagesize | int | 否 | 0 | 分頁大小 | | field | string | 否 | | 設置返回的字段 | | flag | string | 否 | | 通過推薦旗幟篩選內容 | | tag | string | 否 | | 通過標簽篩選內容 | | where | array | 否 | | 自定義查詢條件 | >[danger] 如果需要自定義where條件時,請使用POST方式請求此接口。 where格式:\[\['字段名1', '表達式', '值'\], \['字段名2', '表達式', '值'\]\] >[info] 示例代碼 ``` /* 微信小程序示例 */ wx.request({ url: 'https://cms.hisiphp.com/cms/api/list', data: { cid: 49, pagesize: 20, orderby: 'view desc', timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, header: { 'content-type': 'application/x-www-form-urlencoded' }, method: 'POST', success: function (res) { console.log(res); } }); /* jquery示例 */ $.get( '/cms/api/list', { cid: 49, pagesize: 20, orderby: 'view desc', timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, function(res) { console.log(res); }, 'json'); ``` ## [detail] 內容詳情 >[info]接口地址:/cms/api/detail 請求方式:GET/POST | 屬性名 | 類型 | 必須 | 默認 | 說明 | --- | --- | --- | --- | --- | | id | int | 是 | | 內容ID | >[info] 示例代碼: ``` /* 微信小程序示例 */ wx.request({ url: 'https://cms.hisiphp.com/cms/api/detail', data: { id: 49, timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, header: { 'content-type': 'application/x-www-form-urlencoded' }, method: 'POST', success: function (res) { console.log(res); } }); /* jquery示例 */ $.get( '/cms/api/detail', { id: 49, timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, function(res) { console.log(res); }, 'json'); ``` ## [category] 欄目列表 >[info]接口地址:/cms/api/category 請求方式:GET/POST | 屬性名 | 類型 | 必須 | 默認 | 說明 | --- | --- | --- | --- | --- | | cid | int/var | 是 | 0 | 分類ID,cid和mid最少傳一個 | | mid | int/var | 是 | 2 | 模型ID,cid和mid最少傳一個 | | level | int | 否 | 0 | 返回層級數,0為不限制 | >[info] 示例代碼 ``` /* 微信小程序示例 */ wx.request({ url: 'https://cms.hisiphp.com/cms/api/category', data: { cid: 49, level: 3, timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, header: { 'content-type': 'application/x-www-form-urlencoded' }, method: 'GET', success: function (res) { console.log(res); } }); /* jquery示例 */ $.get( '/cms/api/category', { cid: 49, level: 3, timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, function(res) { console.log(res); }, 'json'); ``` ## [tag] 標簽 >[info]接口地址:/cms/api/tag 請求方式:GET/POST | 屬性名 | 類型 | 必須 | 默認 | 說明 | --- | --- | --- | --- | --- | | mid | int/var| 是 | | 指定模型ID | | orderby | string | 否 | search\_count desc | 排序 | | limit | int | 否 | 10 | 限制返回數量 | >[info] 示例代碼 ``` /* 微信小程序示例 */ wx.request({ url: 'https://cms.hisiphp.com/cms/api/tag', data: { mid: 2, limit: 15, timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, header: { 'content-type': 'application/x-www-form-urlencoded' }, method: 'GET', success: function (res) { console.log(res); } }); /* jquery示例 */ $.get( '/cms/api/tag', { mid: 2, limit: 15, timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, function(res) { console.log(res); }, 'json'); ``` ## [block] 碎片塊 >[info]接口地址:/cms/api/block 請求方式:GET/POST | 屬性名 | 類型 | 必須 | 默認 | 說明 | --- | --- | --- | --- | --- | | name | string | 是 | | 碎片名稱 | >[info] 示例代碼 ``` /* 微信小程序示例 */ wx.request({ url: 'https://cms.hisiphp.com/cms/api/block', data: { name: 'about', timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, header: { 'content-type': 'application/x-www-form-urlencoded' }, method: 'GET', success: function (res) { console.log(res); } }); /* jquery示例 */ $.get( '/cms/api/block', { name: 'about', timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, function(res) { console.log(res); }, 'json'); ``` ## [nav] 導航 >[info]接口地址:/cms/api/nav 請求方式:GET/POST | 屬性名 | 類型 | 必須 | 默認 | 說明 | --- | --- | --- | --- | --- | | group | string | 否 | | 返回指定分組 | | limit | int | 否 | 10 | 限制返回數量 | | cache | bool | 否 | false | 緩存結果集 | >[info] 示例代碼 ``` /* 微信小程序示例 */ wx.request({ url: 'https://cms.hisiphp.com/cms/api/nav', data: { group: 'home', timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, header: { 'content-type': 'application/x-www-form-urlencoded' }, method: 'GET', success: function (res) { console.log(res); } }); /* jquery示例 */ $.get( '/cms/api/nav', { group: 'home', timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, function(res) { console.log(res); }, 'json'); ``` ## [link] 友情鏈接 >[info]接口地址:/cms/api/link 請求方式:GET/POST | 屬性名 | 類型 | 必須 | 默認 | 說明 | --- | --- | --- | --- | --- | | type | string | 是 | | 類型,可選值:image,text,all | | group | string | 否 | | 返回指定分組 | | orderby | string | 否 | sort asc | 排序 | | limit | int | 否 | 10 | 限制返回數量 | >[info] 示例代碼 ``` /* 微信小程序示例 */ wx.request({ url: 'https://cms.hisiphp.com/cms/api/link', data: { type: 'text', group: 'home', timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, header: { 'content-type': 'application/x-www-form-urlencoded' }, method: 'GET', success: function (res) { console.log(res); } }); /* jquery示例 */ $.get( '/cms/api/link', { type: 'text', group: 'home', timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, function(res) { console.log(res); }, 'json'); ``` ## [slide] 幻燈片 >[info]接口地址:/cms/api/slide 請求方式:GET/POST | 屬性名 | 類型 | 必須 | 默認 | 說明 | --- | --- | --- | --- | --- | | type | string | 否 | pc | 類型,可選值:pc,wap | | group | string | 否 | | 返回指定分組 | | orderby | string | 否 | sort asc | 排序 | | limit | int | 否 | 10 | 限制返回數量 | >[info] 示例代碼 ``` /* 微信小程序示例 */ wx.request({ url: 'https://cms.hisiphp.com/cms/api/slide', data: { type: 'wap', group: 'home', timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, header: { 'content-type': 'application/x-www-form-urlencoded' }, method: 'GET', success: function (res) { console.log(res); } }); /* jquery示例 */ $.get( '/cms/api/slide', { type: 'wap', group: 'home', timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, function(res) { console.log(res); }, 'json'); ``` ## [rec] 推薦:rec >[info]接口地址:/cms/api/rec 請求方式:GET/POST | 屬性名 | 類型 | 必須 | 默認 | 說明 | --- | --- | --- | --- | --- | | name | string | 是 | | 調用名稱 | >[info] 示例代碼 ``` /* 微信小程序示例 */ wx.request({ url: 'https://cms.hisiphp.com/cms/api/rec', data: { name: 'product', timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, header: { 'content-type': 'application/x-www-form-urlencoded' }, method: 'GET', success: function (res) { console.log(res); } }); /* jquery示例 */ $.get( '/cms/api/rec', { name: 'product', timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, function(res) { console.log(res); }, 'json'); ``` ## [type] 欄目類型 >[info]接口地址:/cms/api/type 請求方式:GET/POST | 屬性名 | 類型 | 必須 | 默認 | 說明 | --- | --- | --- | --- | --- | | tid | int | 是 | | 類型ID | >[info] 示例代碼 ``` /* 微信小程序示例 */ wx.request({ url: 'https://cms.hisiphp.com/cms/api/type', data: { tid: 123, timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, header: { 'content-type': 'application/x-www-form-urlencoded' }, method: 'GET', success: function (res) { console.log(res); } }); /* jquery示例 */ $.get( '/cms/api/type', { tid: 123, timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, function(res) { console.log(res); }, 'json'); ``` ## [form] 表單 >[info]接口地址:/cms/api/form 請求方式:GET/POST | 屬性名 | 類型 | 必須 | 默認 | 說明 | --- | --- | --- | --- | --- | | name | string | 是 | | 表單名稱 | >[info] 示例代碼 ``` /* 微信小程序示例 */ wx.request({ url: 'https://cms.hisiphp.com/cms/api/form', data: { name: 'test', timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, header: { 'content-type': 'application/x-www-form-urlencoded' }, method: 'GET', success: function (res) { console.log(res); } }); /* jquery示例 */ $.get( '/cms/api/form', { name: 'test', timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, function(res) { console.log(res); }, 'json'); ``` ## [like] 喜歡/點贊 >[info]接口地址:/cms/api/like 請求方式:GET/POST | 屬性名 | 類型 | 必須 | 默認 | 說明 | --- | --- | --- | --- | --- | | id | int | 是 | | 內容ID | >[info] 示例代碼: ``` /* 微信小程序示例 */ wx.request({ url: 'https://cms.hisiphp.com/cms/api/like', data: { id: 49, timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, header: { 'content-type': 'application/x-www-form-urlencoded' }, method: 'POST', success: function (res) { console.log(res); } }); /* jquery示例 */ $.get('/cms/api/like', { id: 49, timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, function(res) { console.log(res); }, 'json'); ``` ## [dislike] 踩/不喜歡 >[info]接口地址:/cms/api/dislike 請求方式:GET/POST | 屬性名 | 類型 | 必須 | 默認 | 說明 | --- | --- | --- | --- | --- | | id | int | 是 | | 內容ID | >[info] 示例代碼: ``` /* 微信小程序示例 */ wx.request({ url: 'https://cms.hisiphp.com/cms/api/dislike', data: { id: 49, timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, header: { 'content-type': 'application/x-www-form-urlencoded' }, method: 'POST', success: function (res) { console.log(res); } }); /* jquery示例 */ $.get('/cms/api/dislike', { id: 49, timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 }, function(res) { console.log(res); }, 'json'); ``` ## [batch] 批量獲取接口數據 >[info]接口地址:/cms/api/batch 請求方式:POST ``` // 小程序請求示例 wx.request({ method: 'POST', url: 'http://www.hisiphp.com/cms/api/batch', data: { // 接口名: {參數名: 參數值} list: {cid: 1},// 請求內容列表接口 category: {cid: 0},// 請求分類接口 slide: {type: 'mini'},// 請求幻燈片接口 timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 // 更多接口.... }, success:function(res) { console.log(res) } }); // AJAX請求示例 $.ajax({ type: 'POST', url: 'http://api.demo.hisiphp.com/v1/articles', data: { // 接口名: {參數名: 參數值} list: {cid: 1},// 請求內容列表接口 category: {cid: 0},// 請求分類接口 slide: {type: 'mini'},// 請求幻燈片接口 timestamp: '2019-05-01 12:12:12',// 時間戳 sign: 'cddb29f7db9647274fc604531ff82cea'// 簽名 // 更多接口.... }, success: function(res) { console.log(res) } }); ``` >[warning] 上面示例代碼的data對象里面的key就是需要獲取的對應接口名(比如列表接口list,欄目接口category等等)
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看