Skip to content

后端 api 和 用户身份验证 #6

@qcl006007

Description

@qcl006007
  1. user 登陆 /api/userSignin,
    用户不存在:
    {
    code: 0,
    data: null,
    message: '不存在该账号'
    }

密码不对:
{
code: 0,
data: null,
message: '您输入的密码不正确'
}

登陆成功: 响应头和响应body中都会带token,后续请求时请在请求头上带上token(token 过期时间10h)
token 中可以解析出 userId, 用于标识用户身份
{
code: 1,
data: user (用户信息),
token: token,
message: '登录成功'
}

  1. 题解部分

创建题解
/api/saveExercise Post

{
title: string
content: string
}

查询我在某天的题解
GET api/myExercise/bydate?date="2020-08-05" query参数最好是这种格式

查询某天的官方题解 : 题解数组[{title, content, createAt, updateAt,}] 至少包含如下字段
GET /api/officialExercises/bydate?date="2020-08-05"

查询某天的精选: 题解数组[{title, content, createAt, updateAt,}] 至少包含如下字段
GET /api/selectedExercises/bydate?date="2020-08-05"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions