• 暂时停更一段时间!
  • 近期网站将陆续进行前端页面改造!
  • 招募网站编辑,联系站长!

从零到企业级SSM电商项目验收测试(一)用户模块测试

文章目录[隐藏]

1.后台管理员登录

/manage/user/login.do

request
String username,
String password
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": "密码错误"
}

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": 22,
        "username": "Geekerstar",
        "email": "123456@qq.com",
        "phone": "16737483839",
        "role": 0,
        "question": "111",
        "answer": "111",
        "createTime": 1531116998000,
        "updateTime": 1531116998000
    }
}

fail

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

5.忘记密码

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

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": "fe5f0c9f-2db7-4f78-a9e9-3d7120ed3002"
}

fail

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

7.忘记密码的重设密码

/user/forget_reset_password.do
localhost:8080/user/forget_reset_password.do?username=aaa&passwordNew=xxx&forgetToken=fe5f0c9f-2db7-4f78-a9e9-3d7120ed3002

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": "服务端异常"
}

丨极客文库, 版权所有丨如未注明 , 均为原创丨
本网站采用知识共享署名-非商业性使用-相同方式共享 3.0 中国大陆许可协议进行授权
转载请注明原文链接:从零到企业级 SSM 电商项目验收测试(一)用户模块测试
喜欢 (0)
[247507792@qq.com]
分享 (0)

邀请您免费 注册账号 登录 即可参与讨论!