Z-Blog Wiki Z-Blog Wiki

Z-Blog官方文库

用户工具

站点工具


zblogphp:development:api:mods:member

用户模块

接口列表

用户登录:login

请求

POST https://example.com/api.php?mod=member&act=login

  • Headers

见通用请求头

  • Cookies

  • Body
属性 类型 示例值 说明
username string Chris 用户名
password string 12345 密码
savedate float 1 登录有效天数

示例:

{
    "username": "Chris",
    "password": "123456",
    "savedate": 1
}

响应

  • Headers

见通用响应头

  • Cookies

  • Body

示例:

{
    "code": 200,
    "message": "操作成功",
    "data": {
        "user": {
            "ID": "1",
            "Level": "1",
            "Status": "0",
            "Name": "zhouzishu",
            "Email": "null@null.com",
            "HomePage": "",
            "CreateTime": "1595241015",
            "PostTime": "1595241015",
            "UpdateTime": "0",
            "Alias": "",
            "Intro": "",
            "Articles": "0",
            "Pages": "1",
            "Comments": "2",
            "Uploads": "1",
            "Template": "index",
            "Metas": {},
            "Url": "https://example.com/?auth=1",
            "Avatar": "https://example.com/zb_users/avatar/0.png",
            "StaticName": "zhouzishu"
        },
        "token": "emhvdXppc2h1fHx8ZDA3MTU4YWQxZjIyOGVkZTAyMGU0NWVmMTY0YTYyYzYzZWU4Y2Y1ZjU3MWZlNTQ0Mjc4M2FmM2U3YWQyNTU4ZTE1OTcyOTk5ODA="
    },
    "error": null
}

data 内容:

类型 示例值 说明
user array {“username”:“Chris”,…} 用户信息
token string emhvdXppc2h1fHx8ZD… 鉴权 token,用于认证

退出登录:logout

请求

POST https://example.com/api.php?mod=member&act=logout

  • Headers

见通用请求头

  • Cookies

见通用请求Cookies

  • Body

响应

  • Headers

见通用响应头

  • Cookies

  • Body

见通用响应体

zblogphp/development/api/mods/member.txt · 最后更改: 2020/08/12 14:53 由 捷闪站长网