```
# AMD项目小程序端 接口说明文档
>注意:文档中出现的参数、地址等英文字符均严格区分大小写。
## 1.返回值
### 1.1返回值结构『JSON』格式
- code(int 必选): 返回代码,表明成功或失败;
- msg(string 必选): 返回信息;
- time(string 必选):时间戳;
- data(object/null 必选): 请求信息时,返回数据。
- 失败时为null,通过msg获取失败信息;
- 成功但不需要数据时为null;
- 成功并且带有数据时,通过data获取数据,data总是为对象。
{"code":401,"msg":"请登录后再操作","time":"1591971423","data":null}
### 2.2常用code值
- 0:失败
- 1: 成功
- 401:请登录
- 403:权限不足
### 2.3 msg消息说明
- 请求(业务处理)成功、失败时,msg中会带有详细描述,例如:
- “登录成功”
- “认证提交成功”
## 3.接口地址
- 接口基地址:「https://domainname/addons/cms/wxapp.」,各接口地址在此地址后连接。
## 4.接口列表
- common: 公共信息接口
- init: 初始化
- poster:生成海报
- index: 首页
- index: 首页
- archives: 文章
- index: 列表
- detail: 详情
- vote: 喜欢、不喜欢
- collect:收藏
- comment:
- index:评论列表
- post:提交评论
- my:我的
- comment:我发表的评论
- aboutus:关于我们
- user:
- profile:个人信息(含头像)
- bind:绑定帐号
- avatar:更新头像信息「我的-点击头像」
- usertags:设置兴趣标签
- 特殊接口:头像上传
- https://domainname/api/common/upload
## 5.详细描述
### 5.1公共信息接口
#### 5.1.1初始化
- <font color="red">接口地址:common/init</font>
- 请求方法:post
- 请求参数:无
- 返回值:
- bannerList : 焦点图列表
- indexTabList :首页Tab列表,注:「默认兴趣标签」
- config:配置信息
- upload:上传配置
- 返回值示例:
{
"code": 1,
"msg": "",
"time": "1573995998",
"data": {
//焦点图列表
"bannerList": [
{
"image": "https://cdn.fastadmin.net/uploads/focus/24.jpg",
"url": "/",
"title": "首页焦点图标题3"
},
{
"image": "https://cdn.fastadmin.net/uploads/focus/6.jpg",
"url": "/",
"title": "首页焦点图标题2"
},
{
"image": "https://cdn.fastadmin.net/uploads/focus/25.jpg",
"url": "/",
"title": "首页焦点图标题1"
}
],
//首页Tab列表
"indexTabList": [
{
"id": 0,
"title": "全部"
},
{
"id": 14,
"title": "网络工具"
},
{
"id": 13,
"title": "媒体工具"
},
{
"id": 12,
"title": "应用软件"
}
],
"config": {
//上传配置
"upload": {
"uploadurl": "http://test/api/ajax/upload",
"cdnurl": "http://www.yoursite.com",
"savekey": "/uploads/{year}{mon}{day}/{filemd5}{.suffix}",
"maxsize": "10mb",
"mimetype": "jpg,png,bmp,jpeg,gif,zip,rar,xls,xlsx",
"multiple": false,
"bucket": "local",
"multipart": []
}
},
//首页Tag列表「全局默认兴趣标签」
"indexTagList": [
{
"id": 0,
"title": "全部"
},
{
"id": 1,
"title": "Google"
},
{
"id": 2,
"title": "网络安全"
},
{
"id": 3,
"title": "人工智能"
}
],
}
}
**注意:兴趣标签「indexTagList」为仿照indexTabList新增项,并且去掉了newsTabList、productTabList**
#### 5.1.2海报接口
- <font color="red">接口地址:common/poster</font>
- 说明:首页海报、文章详情页都使用这个接口
- 生成的小程序码scene值
- 请求方法:post
- 请求参数:
- 「必填」user_id(int):用户ID
- 「必填」aid(int):文档ID
- 首页海报不需要传参数
- 返回值:
- posterurl : 海报地址
- 返回值示例:
{
"code": 1,
"msg": "",
"time": "1592320231",
"data": {
"posterUrl": "https://fastadmin.weicao.group/"
}
}
#### 5.1.3小程序分享接口
- <font color="red">接口地址:common/sharewmp</font>
- 说明:会员点击小程序分享按钮,触发这个接口,会员未登录,不用调用
- 请求方法:post
- 请求参数:
- 「必填」user_id(int):用户ID
- 返回值:
- score : 积分信息
- 返回值示例:
{
"code": 1,
"msg": "",
"time": "1592583803",
"data": {
"score": {
"user_id": 4,
"archives_id": 0,
"likes_id": 0,
"comment_id": 0,
"type": "wmp_share",
"score": "50",
"before": 54,
"after": 104,
"memo": "分享小程序积分",
"createtime": 1592583854,
"id": "19"
}
}
}
#### 5.1.4小程序文章分享接口
- <font color="red">接口地址:common/sharearchives</font>
- 说明:会员点击小程序文章分享按钮,触发这个接口,会员未登录,不用调用
- 请求方法:post
- 请求参数:
- 「必填」user_id(int):用户ID
- 「必填」aid(int):文章ID
- 返回值:
- score : 积分信息
- 返回值示例:
{
"code": 1,
"msg": "",
"time": "1592584238",
"data": {
"score": {
"user_id": 4,
"archives_id": "1",
"likes_id": 0,
"comment_id": 0,
"type": "archives_share",
"score": "20",
"before": 154,
"after": 174,
"memo": "分享文章积分",
"createtime": 1592584245,
"id": "21"
}
}
}
### 5.2 获取小程序首页接口请求
#### 5.2.1 获取小程序首页列表的数据
- 接口地址:index/index
- 请求方法:POST
- 请求参数:无
- 返回值:
- 返回值示例:
{
"code": 1,
"msg": "",
"time": "1574045752",
"data": {
//焦点图列表
"bannerList": [
{
"image": "https://cdn.fastadmin.net/uploads/focus/24.jpg",
"url": "/",
"title": "首页焦点图标题3"
},
{
"image": "https://cdn.fastadmin.net/uploads/focus/6.jpg",
"url": "/",
"title": "首页焦点图标题2"
},
{
"image": "https://cdn.fastadmin.net/uploads/focus/25.jpg",
"url": "/",
"title": "首页焦点图标题1"
}
],
//首页Tab列表
"tabList": [
{
"id": 0,
"title": "全部"
},
{
"id": 14,
"title": "网络工具"
},
{
"id": 13,
"title": "媒体工具"
},
{
"id": 12,
"title": "应用软件"
}
],
//文档列表
"archivesList": [
{
"id": 16,
"user_id": 1,
"channel_id": 4,
"model_id": 1,
"special_id": 0,
"title": "文档标题",
"style": "",
"flag": "",
"image": "https://cdn.fastadmin.net/uploads/20180416/5ad4411db71750.png",
"keywords": "",
"description": "描述内容",
"tags": "互联网,安全",
"views": 6792,
"comments": 0,
"likes": 70,
"dislikes": 0,
"diyname": "",
"createtime": 1523721095,
"updatetime": 1523878887,
"publishtime": 1523635200,
"hasimage": true,
//文档栏目信息
"channel": {
"id": 4,
"name": "安全",
"image": "http://www.yoursite.com/assets/addons/cms/img/noimage.jpg",
"diyname": "security",
"items": 5
},
"likeratio": 100,
"create_date": "1年前"
}
]
}
}
#### 5.3 文章数据接口
#### 5.3.1 文章数据列表
- <font color="red">接口地址:archives/index</font>
- 请求方法:POST
- 请求参数:
- 「必填」model(int):模型ID、主要用于CMS小程序端新闻和产品的区分
- 「选填」channel(int):分类ID、主要用于列表分类的筛选
- 「选填」page(int):分页ID、主要用于CMS小程序端新闻列表分页数据的加载
- 返回值:
- 返回值示例:
{
"code": 1,
"msg": "",
"time": "1574045752",
"data": {
//文档列表
"archivesList": [
{
"id": 16,
"user_id": 1,
"channel_id": 4,
"model_id": 1,
"special_id": 0,
"title": "文档标题",
"style": "",
"flag": "",
"image": "https://cdn.fastadmin.net/uploads/20180416/5ad4411db71750.png",
"keywords": "",
"description": "描述内容",
"tags": "互联网,安全",
"views": 6792,
"comments": 0,
"likes": 70,
"dislikes": 0,
"diyname": "",
"createtime": 1523721095,
"updatetime": 1523878887,
"publishtime": 1523635200,
"hasimage": true,
//文档栏目信息
"channel": {
"id": 4,
"name": "安全",
"image": "http://www.yoursite.com/assets/addons/cms/img/noimage.jpg",
"diyname": "security",
"items": 5
},
"likeratio": 100,
"create_date": "1年前"
}
]
}
}
#### 5.3.2 文章数据详情
- <font color="red">接口地址:archives/detail</font>
- 请求方法:POST
- 请求参数:
- 「必填」id(int):文档ID,主要用于筛选指定文档的详情
- 「选填」diyname:自定义名称,主要用于通过自定义名称筛选文档的数据
- 返回值:
- archivesInfo->likes:点赞总数
- myvote->id:会员点赞信息,存在则表示已经点在
- mycollect->id:会员收藏信息
- 返回值示例:
{
"code": 1,
"msg": "",
"time": "1574046108",
"data": {
//文档详情
"archivesInfo": {
"id": 14,
"user_id": 1,
"channel_id": 4,
"model_id": 1,
"special_id": 0,
"title": "文档标题",
"style": "",
"flag": "",
"image": "https:\/\/cdn.fastadmin.net\/uploads\/20180416\/5ad4411e749b30.jpg",
"keywords": "文档关键字",
"description": "文档描述",
"tags": "安全",
"weigh": 0,
"views": 6376,
"comments": 0,
"likes": 227,
"dislikes": 0,
"diyname": "",
"createtime": 1523720913,
"updatetime": 1523878935,
"publishtime": 1523635200,
"deletetime": null,
"memo": "",
"status": "normal",
"content": "文档详情内容",
"author": "",
"price": "0.00",
"likeratio": 100,
"tagslist": [{
"name": "安全",
"url": "\/cms\/t\/安全.html"
}],
"create_date": "1年前"
},
//文档栏目信息
"channelInfo": {
"id": 4,
"type": "list",
"model_id": 1,
"name": "安全",
"image": "http:\/\/www.yoursite.com\/assets\/addons\/cms\/img\/noimage.jpg",
"flag": "recommend",
"keywords": "",
"description": "",
"diyname": "security",
"outlink": "",
"items": 5,
"pagesize": 10,
"iscontribute": 1,
"isnav": 1,
"createtime": 1508990707,
"updatetime": 1553416184,
},
//评论信息
"commentList": [{
"id": 3,
"user_id": 1,
"type": "archives",
"aid": 34,
"pid": 0,
"content": "完全赞同这样的说法,欢迎提供你的意见或建议。",
"comments": 0,
"ip": "127.0.0.1",
"useragent": "UserAgent",
"subscribe": 1,
"createtime": 1553763331,
"updatetime": 1553763331,
"status": "normal",
"myvote": {
"id": 7,
"archives_id": 3,
"comment_id": 1,
"user_id": 4,
"type": "comment",
"createtime": 1592502819
},
"subComments": [],
"subCommentsCount": 0,
"user": {
"id": 1,
"nickname": "admin",
"avatar": "头像链接",
"email": "admin@163.com",
"url": "\/u\/1"
},
"create_date": "7月前"
}],
"myvote": {
"id": 5,
"archives_id": 4,
"user_id": 4,
"createtime": 1592497223
},
"mycollect": {
"id": 5,
"archives_id": 4,
"user_id": 4,
"createtime": 1592497223
}
}
}
#### 5.3.3 点赞与撤销
- <font color="red">接口地址:archives/vote</font>
- 说明:不登录不允许点赞,点赞后再次点击将撤销点赞
- 请求方法:POST
- 请求参数:
- 「必填」id(int):文档ID,文档ID
- 「必填」type(string):点击类型,like「点赞」或revoke「撤销点赞」
- 「必填」user_id:用户id
- 返回值:
- likes:点赞总数
- myvote: 点赞记录信息,记录用户文章点赞状态
- 撤销时,myvote返回内容为null
- 返回值示例:
{
"code": 1,
"msg": "操作成功!",
"time": "1592496364",
"data": {
"likes": 1,
"myvote": {
"archives_id": 4,
"user_id": 4,
"id": "1",
}
}
}
#### 5.3.4 收藏与撤销
- <font color="red">接口地址:archives/collect</font>
- 说明:不登录不允许收藏,收藏后再次点击将撤销收藏
- 请求方法:POST
- 请求参数:
- 「必填」id(int):文档ID,文档ID
- 「必填」type(string):点击类型,collect「收藏」或revoke「撤销收藏」
- 「必填」user_id:用户id
- 返回值:
- collect:收藏总数
- mycollect: 收藏记录信息,记录用户文章收藏状态
- 撤销时,mycollect返回内容为空
- 返回值示例:
{
"code": 1,
"msg": "操作成功!",
"time": "1592497882",
"data": {
"collect": 1,
"mycollect": {
"archives_id": 1,
"user_id": 4,
"id": "6"
}
}
}
#### 5.3.4 付费订单提交
- 接口地址:archives/order
- 请求方法:POST
- 请求参数:
- id(int):文档ID
- 返回值:
- 返回值示例:
{
"code": 1,
"msg": "",
"time": "1574046108",
"data": {
"return_code": "SUCCESS",
"return_msg": "OK"
"appid":"5",
"mch_id":"1434511111",
"device_info": "1000",
"nonce_str":"a17lr7u47sFfZlnZ",
"sign":"37A96FE5DB50CF32419549144A10F2D7",
"result_code":"SUCCESS",
"prepay_id": "wx2019111814224218dc7b5ce20844101928",
"trade_type": "JSAPI"
}
}
### 5.4 文章评论
#### 5.4.1 评论列表
- <font color="red">接口地址:comment/index</font>
- 请求方法:POST
- 请求参数:
- 「必填」aid(int):文档id
- 「必填」page(int):分页ID,默认1
- 「选填」user_id(int):用户ID
- 返回值:
- subCommentsCount:子评论总数
- subComments:子评论列表
- likes:点赞数
- replySubCommentsCount:子评论回复总数
- 返回值示例
{
"code": 1,
"msg": "",
"time": "1592489990",
"data": {
"commentList": [
{
"id": 11,
"user_id": 2,
"type": "archives",
"aid": 3,
"pid": 0,
"content": "生生世世生生世世",
"comments": 0,
"likes": 0,
"ip": "127.0.0.1",
"useragent": "Mozilla/5.0 (Windows NT 10.0; WOW64;lv1u1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.9 Safari/537.36",
"subscribe": 0,
"createtime": 1592472336,
"updatetime": 1592472336,
"deletetime": null,
"status": "normal",
"subComments": [],
"subCommentsCount": 0,
"user": {
"id": 2,
"nickname": "try2816",
"avatar": "https://fastadmin.weicao.group/uploads/20200618/48f8151508b793a9994955cfb61f51e2.png",
"email": "2816@try.com",
"url": "/u/2"
},
"create_date": "4小时前"
},
{
"id": 9,
"user_id": 2,
"type": "archives",
"aid": 3,
"pid": 0,
"content": "哈哈哈哈哈",
"comments": 0,
"likes": 0,
"ip": "127.0.0.1",
"useragent": "Mozilla/5.0 (Windows NT 10.0; WOW64;lv1u1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.9 Safari/537.36",
"subscribe": 1,
"createtime": 1592472309,
"updatetime": 1592472309,
"deletetime": null,
"status": "normal",
"subComments": [
{
"id": 17,
"user_id": 2,
"type": "archives",
"aid": 3,
"pid": 9,
"content": "WTF6",
"comments": 0,
"likes": 0,
"ip": "127.0.0.1",
"useragent": "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.3 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1 wechatdevtools/1.03.2005140 MicroMessenger/7.0.4 Language/zh_CN webview/",
"subscribe": 0,
"createtime": 1592477791,
"updatetime": 1592477791,
"deletetime": null,
"status": "normal",
"replySubCommentsCount": 0,
"user": {
"id": 2,
"nickname": "try2816",
"avatar": "https://fastadmin.weicao.group/uploads/20200618/48f8151508b793a9994955cfb61f51e2.png",
"email": "2816@try.com",
"url": "/u/2"
},
"create_date": "3小时前"
},
{
"id": 16,
"user_id": 2,
"type": "archives",
"aid": 3,
"pid": 9,
"content": "WTF5",
"comments": 0,
"likes": 0,
"ip": "127.0.0.1",
"useragent": "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.3 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1 wechatdevtools/1.03.2005140 MicroMessenger/7.0.4 Language/zh_CN webview/",
"subscribe": 0,
"createtime": 1592477787,
"updatetime": 1592477787,
"deletetime": null,
"status": "normal",
"replySubCommentsCount": 0,
"user": {
"id": 2,
"nickname": "try2816",
"avatar": "https://fastadmin.weicao.group/uploads/20200618/48f8151508b793a9994955cfb61f51e2.png",
"email": "2816@try.com",
"url": "/u/2"
},
"create_date": "3小时前"
}
],
"subCommentsCount": 7,
"user": {
"id": 2,
"nickname": "try2816",
"avatar": "https://fastadmin.weicao.group/uploads/20200618/48f8151508b793a9994955cfb61f51e2.png",
"email": "2816@try.com",
"url": "/u/2"
},
"create_date": "4小时前"
}
]
}
}
#### 5.4.2 评论列表
- <font color="red">接口地址:comment/commentDetail</font>
- 请求方法:POST
- 请求参数:
- 「必填」aid(int):文档id
- 「必填」page(int):分页ID,默认1
- 「选填」user_id(int):用户ID
- 「选填」cid:评论ID
- 点击评论根据cid获取评论信息&子评论信息
- 返回值:
- subCommentsCount:子评论总数
- subComments:子评论列表
- likes:点赞数
- replySubCommentsCount:子评论回复总数
- 返回值示例
{
"code": 1,
"msg": "",
"time": "1592489786",
"data": {
"commentList": {
"id": 9,
"user_id": 2,
"type": "archives",
"aid": 3,
"pid": 0,
"content": "哈哈哈哈哈",
"comments": 0,
"likes": 0,
"ip": "127.0.0.1",
"useragent": "Mozilla/5.0 (Windows NT 10.0; WOW64;lv1u1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.9 Safari/537.36",
"subscribe": 1,
"createtime": 1592472309,
"updatetime": 1592472309,
"deletetime": null,
"status": "normal",
"subCommentsCount": 7,
"subComments": [
{
"id": 17,
"user_id": 2,
"type": "archives",
"aid": 3,
"pid": 9,
"content": "WTF6",
"comments": 0,
"likes": 0,
"ip": "127.0.0.1",
"useragent": "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.3 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1 wechatdevtools/1.03.2005140 MicroMessenger/7.0.4 Language/zh_CN webview/",
"subscribe": 0,
"createtime": 1592477791,
"updatetime": 1592477791,
"deletetime": null,
"status": "normal",
"replySubCommentsCount": 0,
"user": {
"id": 2,
"nickname": "try2816",
"avatar": "https://fastadmin.weicao.group/uploads/20200618/48f8151508b793a9994955cfb61f51e2.png",
"email": "2816@try.com",
"url": "/u/2"
},
"create_date": "3小时前"
},
{
"id": 16,
"user_id": 2,
"type": "archives",
"aid": 3,
"pid": 9,
"content": "WTF5",
"comments": 0,
"likes": 1,
"ip": "127.0.0.1",
"useragent": "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3_1 like Mac OS X) AppleWebKit/603.1.3 (KHTML, like Gecko) Version/10.0 Mobile/14E304 Safari/602.1 wechatdevtools/1.03.2005140 MicroMessenger/7.0.4 Language/zh_CN webview/",
"subscribe": 0,
"createtime": 1592477787,
"updatetime": 1592477787,
"deletetime": null,
"status": "normal",
"myvote": {
"id": 7,
"archives_id": 3,
"comment_id": 1,
"user_id": 4,
"type": "comment",
"createtime": 1592502819
},
"replySubCommentsCount": 0,
"user": {
"id": 2,
"nickname": "try2816",
"avatar": "https://fastadmin.weicao.group/uploads/20200618/48f8151508b793a9994955cfb61f51e2.png",
"email": "2816@try.com",
"url": "/u/2"
},
"create_date": "3小时前"
}
],
"user": {
"id": 2,
"nickname": "try2816",
"avatar": "https://fastadmin.weicao.group/uploads/20200618/48f8151508b793a9994955cfb61f51e2.png",
"email": "2816@try.com",
"url": "/u/2"
},
"create_date": "4小时前"
}
}
}
#### 5.4.3 发表评论
- <font color="red">接口地址:comment/post</font>
- 回复成功后,最新数据通过comment/index获取最新评论内容
- 请求方法:POST
- 请求参数:
- aid(int):文档id
- pid(int):回复的评论ID
- content(string):评论内容
- user_id(int):用户id
- 返回值:
- 返回值示例:
{
"code": 1,
"msg": "评论成功",
"time": "1591993687",
"data": {
"token": "1f11995e2378fba293eeed6764afdb92"
}
}
#### 5.4.4 点赞评论
- <font color="red">接口地址:comment/vote</font>
- 说明:不登录不允许点赞,点赞后再次点击将撤销点赞
- 请求方法:POST
- 请求参数:
- 「必填」id(int):文档ID
- 「必填」cid(int):评论ID
- 「必填」type(string):点击类型,like「点赞」或revoke「撤销点赞」
- 「必填」user_id:用户id
- 返回值:
- likes:点赞总数
- myvote: 点赞记录信息,记录用户评论点赞状态
- 撤销时,myvote返回内容为null
- 返回值示例:
{
"code": 1,
"msg": "操作成功!",
"time": "1592496364",
"data": {
"likes": 1,
"myvote": {
"archives_id": 4,
"comment_id": 4,
"user_id": 4,
"id": "1",
}
}
}
### 5.5 我的评论和关于我们API接口请求
#### 5.5.1 我发表的评论
- 接口地址:my/comment
- 请求方法:POST
- 请求参数:
- 无
- 返回值:
- 返回值示例:
{
"code": 1,
"msg": "",
"time": "1574046108",
"data": {
//评论信息
"commentList": [{
"id": 3,
"user_id": 1,
"type": "archives",
"aid": 34,
"pid": 0,
"content": "完全赞同这样的说法,欢迎提供你的意见或建议。",
"comments": 0,
"ip": "127.0.0.1",
"useragent": "UserAgent",
"subscribe": 1,
"createtime": 1553763331,
"updatetime": 1553763331,
"status": "normal",
"create_date": "7月前"
}]
}
}
#### 5.5.2 关于我们
- 接口地址:my/aboutus
- 请求方法:POST
- 请求参数:
- 无
- 返回值:
- 返回值示例:
{
"code": 1,
"msg": "",
"time": "1574050306",
"data": {
"pageInfo": {
"id": 1,
"category_id": 0,
"type": "page",
"title": "FastAdmin - 基于ThinkPHP5和Bootstrap的极速后台开发框架",
"keywords": "",
"description": "",
"flag": "",
"image": "http://www.yoursite.com/assets/addons/cms/img/noimage.jpg",
"content": "内容",
"icon": "",
"views": 547,
"likes": 225,
"dislikes": 0,
"comments": 0,
"diyname": "aboutus",
"createtime": 1508933935,
"updatetime": 1553769449,
"weigh": 1,
}
}
}
### 5.6 会员相关接口请求
#### 5.6.1 会员登录接口
- <font color="red">接口地址:user/login</font>
- 请求方法:POST
- 请求参数:
- 「必填」code(int):JSCode,主要用于后台获取session_key使用
- 「必填」rawData(string):用户信息数据,小程序端用户信息
- 返回值:
- 返回值示例:
{
"code": 1,
"msg": "登录成功",
"time": "1592239153",
"data": {
"userInfo": {
"id": 11,
"username": "user11",
"nickname": "时不我待",
"mobile": "",
"avatar": "https:\/\/fastadmin.weicao.group\/uploads\/20200615\/ea7f113419cf2edb6ca8065401e90adc.jpg",
"level": 5,
"bio": "123456",
"money": "0.00",
"score": 100,
"token": "0d1c9921-9ee3-4123-895b-f93952025105",
"user_id": 11,
"createtime": 1592239153,
"expiretime": 0,
"expires_in": 31536000
},
"userTag": {
"userTagSetStatus": 1,
"userTagList": [{
"id": 2,
"title": "生活百科"
}, {
"id": 3,
"title": "大数据"
}, {
"id": 5,
"title": "Movie"
}]
},
"allTag": [{
"id": 1,
"title": "互联网"
}, {
"id": 2,
"title": "生活百科"
}, {
"id": 3,
"title": "大数据"
}, {
"id": 4,
"title": "WTF"
}, {
"id": 5,
"title": "Movie"
}, {
"id": 6,
"title": "两性"
}, {
"id": 7,
"title": "开源"
}]
}
}
**注:allTag为当前所有标签列表,userTag为会员已经设置的兴趣标签,同时用作登录后顶部的兴趣标签,未设置兴趣标签时「userTagSetStatus」的值为0,设置后为1**
#### 5.6.2 帐号绑定
- 接口地址:user/bind
- 请求方法:POST
- 请求参数:
- 「必填」account(string):用户名,用户名、邮箱或手机号
- 「必填」password(string):密码
- 返回值:
- 返回值示例:
{
"code": 1,
"msg": "绑定成功",
"time": "1574046108",
"data": {
//评论信息
"userInfo": {
//用户信息
}
}
}
#### 5.6.3 修改头像
- 接口地址:user/avatar
- 请求方法:POST
- 请求参数:
- 「必填」avatar(string):头像
- 返回值:
- 返回值示例:
{
"code": 1,
"msg": "修改成功",
"time": "1574046108",
"data": {
//评论信息
"userInfo": {
//用户信息
}
}
}
#### 5.6.4 个人信息
- 接口地址:user/profile
- 请求方法:POST
- 请求参数:
- 「必填」username(string):用户名
- 「必填」nickname(string):昵称
- 「必填」bio(string):BIO
- 「必填」avatar(string):头像
- user_id:用户ID
- 返回值:
- 返回值示例:
{
"code": 1,
"msg": "修改成功",
"time": "1574046108",
"data": {
//评论信息
"userInfo": {
//用户信息
}
}
}
#### 5.6.5 设置兴趣标签
- <font color="red">接口地址:user/usertags</font>
- 请求方法:POST
- 请求参数:
- 「必填」tags(string):兴趣标签ID,多个ID似乎用','分隔
- 例如:1,2,3
- 返回值:
- 返回值示例:
{
"code": 1,
"msg": "",
"time": "1592290600",
"data": {
"userTag": {
"userTagSetStatus": 1,
"userTagList": [
{
"id": 1,
"title": "互联网"
},
{
"id": 2,
"title": "生活百科"
},
{
"id": 3,
"title": "大数据"
}
]
}
}
}
**打开兴趣标签页面,标签数据根据登录接口返回的内容展示**
### 5.7 积分商城
####5.7.1 商城首页
- 接口地址:mall/index
- 不登录时不显示积分、头像
- 请求方法:POST
- 请求参数:
- 「选填」user_id(int):用户id
- 「选填」page(int):当前页
- 「选填」orderby:排序项,如:score
- 「选填」orderway:排序规则,如:desc asc
- 「选填」available:可兑换商品传递1,默认0
- 返回值:
- 返回值示例:
```