-
Notifications
You must be signed in to change notification settings - Fork 44
Rex Lee(李俊) edited this page Oct 19, 2018
·
2 revisions
前缀 /api/v1
GET /app/state
response
{
"ok": true,
"state": 0
}
state | 含义 |
---|---|
0 | 未安装 |
1 | 已安装 |
POST /app/install
request
{
"http_port": 4000,
"db_type": "mysql",
"db_host": "127.0.0.1",
"db_port": 3306,
"db_name": "blog",
"db_user": "blog",
"db_password": ""
}
名称 | 是否必须 | 含义 |
---|---|---|
http_port | 是 | 安装后的 http 服务端口 |
db_type | 是 | 数据库类型,支持 mysql 或 sqlite
|
db_host | 否 | mysql 数据库地址 |
db_port | 否 | mysql 数据库端口 |
db_name | 否 | mysql 数据库名称 |
db_user | 否 | mysql 数据库用户名 |
db_password | 否 | mysql 数据库密码 |
response
{
"ok": true
}
说明
用户请求安装应用接口后,应用安装完成会自动重启
POST /user_login
request
{
"username": "",
"password": ""
}
response
{
"ok": true
}
cookie
[sid] --> 0cde1aaa8bb2b5f202c58371bbca9e50
POST /admin/user_logout
request(login require)
(empty)
response
{
"ok": true
}
GET /username_check?username=test
名称 | 是否必须 | 含义 |
---|---|---|
username | 是 | 待匹配的用户名 |
POST /user_get_password
POST /register
request
{
"username": "",
"password": "",
"email": "",
"phone": ""
}
名称 | 是否必须 | 含义 |
---|---|---|
username | 是 | 用户名 |
是 | ||
password | 是 | 密码 |
phone | 否 | 手机 |
response
{
"ok": true
}
POST /article
request
{
"title": "this is a title",
"content": "this is article content",
"status": 0
}
PUT /article/publish/:id
PUT /article/modify/:id
GET /article/list
GET /article/:id
DELETE /article/:id