项目测试Wikis(1)门户_用户接口

####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,type
str可以是用户名也可以是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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值