易优小程序API


通用

<h5>简要描述</h5> <ul> <li>首页接口</li> </ul> <h5>请求URL</h5> <ul> <li><code>https://您的域名/index.php?m=api&amp;c=v1.Api&amp;a=index&amp;_ajax=1</code></li> </ul> <h5>请求方式</h5> <ul> <li>POST </li> </ul> <h5>参数</h5> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">必选</th> <th style="text-align: left;">类型</th> <th>说明</th> <th>示例</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">api标签名_序号</td> <td style="text-align: left;">否</td> <td style="text-align: left;">string</td> <td>多个标签属性以&amp;拼接</td> <td>ekey=序号&amp;typeid=12</td> </tr> </tbody> </table> <p><a href="https://www.eyoucms.com/doc/api/" title="什么是api标签名?初次入门先了解api标签名,具体点击这里查阅手册">什么是api标签名?初次入门先了解api标签名,具体点击这里查阅手册</a> 注意:如果存在相同api标签名,请在后面加上( _序号,比如:apiArclist_1 ),以便区分同个标签返回不同数据。</p> <h5>示例代码</h5> <pre><code>wx.request({ url: 'https://demo.eyoucms.com/index.php?m=api&amp;c=v1.Api&amp;a=index&amp;_ajax=1', //仅为示例,并非真实的接口地址 data: { apiAdv_1: `ekey=1&amp;pid=3`, // 广告位标签adv apiArclist_1: `ekey=1&amp;channel=2&amp;limit=4`, // 第一个文档列表标签arclist apiArclist_2: `ekey=2&amp;typeid=12&amp;limit=3`, // 第二个文档列表标签arclist apiArclist_3: `ekey=3&amp;typeid=4&amp;limit=4`, // 第三个文档列表标签arclist apiType_1: `ekey=1&amp;typeid=8&amp;addfields=content`, // 指定栏目标签type apiGlobal: `ekey=1`, // 全局配置变量标签global // 这里可以根据需求填写更多的api标签 }, method: 'POST', header: { 'content-type': 'application/json' // 默认值 }, success (res) { // 特别说明:中括号[1]的数字必须与api标签的参数ekey=1值对应,否则数据对不上。 let adv_1 = res.data.apiAdv[1], // adv广告位数据 arclist_1 = res.data.apiArclist[1], // 第一个arclist文档列表数据 arclist_2 = res.data.apiArclist[2], // 第二个arclist文档列表数据 arclist_3 = res.data.apiArclist[3], // 第三个arclist文档列表数据 type_1 = res.data.apiType[1], // type指定栏目数据 global = res.data.apiGlobal[1]; // global全局配置变量数据 // 更多示例代码请参考开源小程序 console.log(res.data) } })</code></pre> <h5>接口测试</h5> <p><a href="http://runapi.showdoc.cc">http://runapi.showdoc.cc</a></p> <h5>返回示例</h5> <pre><code>{ "code": 1, // 状态码,1表示成功,0表示失败 "msg": "success", "time": "1622253052", "data": { "apiAdv": { // 全部adv广告位标签的数据 "1": { // 第一个apiAdv_1广告位数据 "data": [ { "id": 9, "title": "", "links": "", "litpic": "https://demo.eyoucms.com/uploads/allimg/20190722/08536d1944213a1632dde5489c0f2e1a.jpg", "intro": "" }, { "id": 11, "title": "", "links": "", "litpic": "https://demo.eyoucms.com/uploads/allimg/20190722/21550a2a81a09d8bf109bcaa826ec487.jpg", "intro": "" }, …… ] } }, "apiArclist": { // 全部arclist文档列表标签的数据 "1": { // 第一个apiArclist_1文档列表数据,这里是指定了模型ID的文档列表 "data": [ // 返回的文档列表数据 ] }, "2": { // 第二个apiArclist_1文档列表数据,如果指定栏目ID的文档列表,也会返回栏目的基本数据 "data": [ // 返回的文档列表数据 ], "arctype": { // 返回的当前栏目数据 } }, "3": { // 第三个apiArclist_1文档列表数据,如果指定栏目ID的文档列表,也会返回栏目的基本数据 "data": [ // 返回的文档列表数据 ], "arctype": { // 返回的当前栏目数据 } } }, "apiType": { // 全部type指定栏目标签的数据 "1": { // 第一个apiType_1指定栏目数据 "data": { // 返回的指定栏目数据 } } }, "global": { // 全局配置变量的数据,一般不像arclist标签存在多个global标签数据 "1": { "data": { "web_name": "易优Demo站点", "web_logo": "/uploads/allimg/20210114/3-210114142305437.png", "web_basehost": "https://demo.eyoucms.com", "web_description": "易优Demo站点", "web_copyright": "Copyright © 2012-2018 EYOUCMS. 易优CMS 版权所有", "web_title": "易优Demo站点 - Powered by Eyoucms.com", "web_attr_1": "400-123-4567", …… 更多自定义变量 } } }, …… } } </code></pre> <h5>返回参数说明</h5> <table> <thead> <tr> <th style="text-align: left;">参数名</th> <th style="text-align: left;">类型</th> <th>说明</th> </tr> </thead> <tbody> <tr> <td style="text-align: left;">code</td> <td style="text-align: left;">int</td> <td>状态值,1:成功;0:失败</td> </tr> <tr> <td style="text-align: left;">msg</td> <td style="text-align: left;">string</td> <td>操作说明文案</td> </tr> <tr> <td style="text-align: left;">time</td> <td style="text-align: left;">int</td> <td>返回时间戳</td> </tr> <tr> <td style="text-align: left;">data</td> <td style="text-align: left;">array</td> <td>api标签的所有数据</td> </tr> </tbody> </table> <h5>备注</h5> <ul> <li>更多api接口持续完善中,欢迎踊跃参与补充与反馈</li> </ul> <p>感谢对易优小程序的支持,交流加QQ好友:1105415366 备注:gitee</p>

页面列表

ITEM_HTML