博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
项目测试Wikis(1)门户_用户接口
阅读量:4484 次
发布时间:2019-06-08

本文共 2913 字,大约阅读时间需要 9 分钟。

####1.登录

/user/login.do post(代码需要post方式请求),开放get,方便调试

request

username,password

response

fail

{    "status": 1,    "msg": "密码错误"}

success

{    "status": 0,    "data": {        "id": 12, "username": "aaa", "email": "aaa@163.com", "phone": null, "role": 0, "createTime": 1479048325000, "updateTime": 1479048325000 } }

####2.注册 /user/register.do

request

username,password,email,phone,question,answer

response

success

{    "status": 0,    "msg": "校验成功"}

fail

{    "status": 1,    "msg": "用户已存在"}

####3.检查用户名是否有效

/user/check_valid.do

/check_valid.do?str=admin&type=username就是检查用户名。

request

str,typestr可以是用户名也可以是email。对应的type是username和email

response

success

{    "status": 0,    "msg": "校验成功"}

fail

{    "status": 1,    "msg": "用户已存在"}

####4.获取登录用户信息 /user/get_user_info.do

request

无参数

response

success

{    "status": 0,    "data": {        "id": 12, "username": "aaa", "email": "aaa@163.com", "phone": null, "role": 0, "createTime": 1479048325000, "updateTime": 1479048325000 } }

fail

{    "status": 1,    "msg": "用户未登录,无法获取当前用户信息"}

####5.忘记密码 /user/forget_get_question.do

localhost:8080/user/forget_get_question.do?username=geely

request

username

response

success

{    "status": 0,    "data": "这里是问题"}

fail

{    "status": 1,    "msg": "该用户未设置找回密码问题"}

####6.提交问题答案 /user/forget_check_answer.do

localhost:8080/user/forget_check_answer.do?username=aaa&question=aa&answer=sss

request

username,question,answer

response

正确的返回值里面有一个token,修改密码的时候需要用这个。传递给下一个接口

success

{    "status": 0,    "data": "531ef4b4-9663-4e6d-9a20-fb56367446a5"}

fail

{    "status": 1,    "msg": "问题答案错误"}

####7.忘记密码的重设密码 /user/forget_reset_password.do

localhost:8080/user/forget_reset_password.do?username=aaa&passwordNew=xxx&forgetToken=531ef4b4-9663-4e6d-9a20-fb56367446a5

request

username,passwordNew,forgetToken

response

success

{    "status": 0,    "msg": "修改密码成功"}

fail

{    "status": 1,    "msg": "修改密码操作失效"}

{    "status": 1,    "msg": "token已经失效"}

####8.登录中状态重置密码 /user/reset_password.do

request

passwordOld,passwordNew

response

success

{    "status": 0,    "msg": "修改密码成功"}

fail

{    "status": 1,    "msg": "旧密码输入错误"}

####9.登录状态更新个人信息 /user/update_information.do

request

email,phone,question,answer

response

success

{    "status": 0,    "msg": "更新个人信息成功"}

fail

{    "status": 1,    "msg": "用户未登录"}

####10.获取当前登录用户的详细信息,并强制登录 /user/get_information.do

request

无参数

response

success

{    "status": 0,    "data": {        "id": 1, "username": "admin", "password": "", "email": "admin@163.com", "phone": "13800138000", "question": "question", "answer": "answer", "role": 1, "createTime": 1478422605000, "updateTime": 1491305256000 } }

fail

{    "status": 10,    "msg": "用户未登录,无法获取当前用户信息,status=10,强制登录"}

####11.退出登录 /user/logout.do

request

response

success

{    "status": 0,    "msg": "退出成功"}

fail

{    "status": 1,    "msg": "服务端异常"}

####模板

/user/.do

request

k

response

success

k

fail

k

转载于:https://www.cnblogs.com/figsprite/p/10913531.html

你可能感兴趣的文章
002
查看>>
WCF服务“*”有零个应用程序(非基础结构)终结点。这可能是因为未找到应用程序的配置文件,或者在配置文件中未找到与服务名称匹配的服务元素,或者服务元素中未定义终结点。...
查看>>
cocos2d 读书随笔《cocos2d-x游戏开发技术精讲》
查看>>
Asterisk 代码架构概述
查看>>
中兴电信光纤猫F450获取管理员密码方法
查看>>
申请TexturePacker 或 PhysicsEditor free licenses
查看>>
kafka启动报错&问题解决
查看>>
nginx反向代理下没有获取到正确的clientIP问题发散
查看>>
python周报第一周
查看>>
IBM MQ 创建以及常见问题集锦
查看>>
Office文件的奥秘——.NET平台下不借助Office实现Word、Powerpoint等文件的解析(1)
查看>>
SQL Server 服务器磁盘测试之SQLIO篇(一)
查看>>
sun.misc.Unsafe 详解
查看>>
食堂排队问题的一个实现
查看>>
Git 回滚代码的正确姿势
查看>>
构造函数、析构函数、虚析构函数、纯虚析构函数要点
查看>>
Python批量获取京东商品列表信息
查看>>
2017.7.10 C组总结
查看>>
SourceTree下载 及使用
查看>>
MyEclipse下安装FatJar打包工具
查看>>