🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
## 公共接口(Common) ## 应用初始化接口\[init\]【免登录】 应用初始化时调用的接口 ### 请求URL http://www.yoursite.com/addons/cms/api.common/init ### 请求方法 GET ### 返回字段解析 | **Body参数名** | 类型 | 描述 | | --- | --- | --- | | bannerList | array | 轮播图 | | config | object | 上传配置,支付方式配置 | | `__token__` | string | 校验token | | navbar | object | 顶部导航条 | | theme | object | 主题颜色 | | tabbar | object | 底部导航栏 | ### 返回值 ~~~json { "code": 1, "msg": "", "time": "1616565802", "data": { "bannerList": [ { "image": "https://cdn.fastadmin.net/uploads/focus/24.jpg", "url": "http://www.fastadmin.net", "title": "首页焦点图标题3" }, { "image": "https://cdn.fastadmin.net/uploads/focus/6.jpg", "url": "http://www.fastadmin.net", "title": "首页焦点图标题2" }, { "image": "https://cdn.fastadmin.net/uploads/focus/25.jpg", "url": "http://www.fastadmin.net", "title": "首页焦点图标题1" } ], "config": { "upload": { "uploadurl": "http://www.fa.com/api/common/upload", "cdnurl": "http://www.fa.com", "savekey": "/uploads/{year}{mon}{day}/{filemd5}{.suffix}", "maxsize": "50mb", "mimetype": "jpg,png,bmp,jpeg,gif,zip,rar,xls,xlsx,sql,wav,mp3,mp4,.fbx", "multiple": false, "chunking": false, "chunksize": 2097152, "bucket": "local", "multipart": [], "storage": "local" }, "paytypelist": "wechat,alipay,balance", "defaultpaytype": "balance" }, "__token__": "bdd2a7dfbefb7b28edb73a3a81fe8843", "navbar": { "titleColor": "#fff", "bgColor": { "background": "#374486" }, "backIconColor": "#fff", "backTextStyle": { "color": "#fff" }, "titleSize": "35", "isshow": true }, "theme": { "color": "#ffffff", "bgColor": "#374486" }, "tabbar": { "color": "#999", "selectColor": "#000", "bgColor": "#ffffff", "height": "100", "borderTop": true, "iconSize": "40", "midButton": false, "midButtonSize": "60", "list": [ { "image": "http://www.fa.com/assets/addons/cms/img/tabbar/home.png", "selectedImage": "http://www.fa.com/assets/addons/cms/img/tabbar/home-hl.png", "text": "首页", "path": "/pages/index/index", "midButton": false, "count": 0, "isDot": false, "badgeColor": "#ffffff", "badgeBgColor": "#374486" }, { "image": "http://www.fa.com/assets/addons/cms/img/tabbar/article.png", "selectedImage": "http://www.fa.com/assets/addons/cms/img/tabbar/article-hl.png", "text": "资讯", "path": "/pages/article/article?model=1", "midButton": false, "count": 0, "isDot": false, "badgeColor": "#ffffff", "badgeBgColor": "#374486" }, { "image": "http://www.fa.com/assets/addons/cms/img/tabbar/image.png", "selectedImage": "http://www.fa.com/assets/addons/cms/img/tabbar/image-hl.png", "text": "产品", "midButton": true, "path": "/pages/product/product?model=2", "count": 0, "isDot": false, "badgeColor": "#ffffff", "badgeBgColor": "#374486" }, { "image": "http://www.fa.com/assets/addons/cms/img/tabbar/my.png", "selectedImage": "http://www.fa.com/assets/addons/cms/img/tabbar/my-hl.png", "text": "我的", "path": "/pages/my/my", "midButton": false, "count": 0, "isDot": false, "badgeColor": "#ffffff", "badgeBgColor": "#374486" } ], "isshow": true } } } ~~~ ## 栏目分类接口\[getCategory\]【免登录】 可根据模型或栏目调用对应栏目的接口,模型id和栏目id按自己需求取值 ### 请求URL http://www.yoursite.com/addons/cms/api.common/getCategory ### 请求方法 GET ### 请求参数 | Body参数名 | 类型 | 必需 | 描述 | 示例 e.g. | | --- | --- | --- | --- | --- | | model | number | 否 | 模型id | 1 | | channel | number | 否 | 栏目id | 1 | > channel=-1&model=-1 对于首页,应用初始化,无法给传参,默认传-1,取导航的设置参数 ### 返回值 ~~~css { "code": 1, "msg": "", "time": "1616565802", "data": [ { "id": 0, "title": "全部" }, { "id": 25, "title": "小硬件" }, { "id": 24, "title": "三级栏目" }, { "id": 1, "title": "新闻中心" }, { "id": 14, "title": "网络工具" }, { "id": 13, "title": "媒体工具" }, { "id": 12, "title": "应用软件" } ] } ~~~ ## 关联数据接口\[selectpage\]【免登录】 比如自定义表单的关联单选,多选数据 ### 请求URL http://www.yoursite.com/addons/cms/api.common/selectpage ### 请求方法 GET ### 请求参数 | Body参数名 | 类型 | 必需 | 描述 | 示例 e.g. | | --- | --- | --- | --- | --- | | id | number | 是 | 关联配置的id | 1 | | pageNumber | number | 是 | 页码 | 1 | | pageSize | number | 是 | 分页大小 | 10 | | q\_word | array | 否 | 搜索关键词 | \['关键词'\] | | andOr | string | 否 | 搜索条件 | OR | | orderBy | array | 否 | 排序 | \[\['id', 'asc'\]\] | | keyValue | string | 否 | 主键值 | name | | searchField | array | 否 | 搜索字段 | \['name'\] | | custom | array | 否 | 自定义搜索条件 | \[\] | ### 返回值 ~~~json { "list": [ { "id": 24, "username": "fast", "pid": 0 }, { "id": 522, "username": "FSli8Lbp5W", "pid": 0 }, { "id": 541, "username": "STlrIcXvkO", "pid": 0 }, { "id": 564, "username": "syvrJ7ETnDocWOVj1x3k", "pid": 0 }, { "id": 530, "username": "YDleSRHnjL", "pid": 0 } ], "total": 15 } ~~~