Introduction
站点开放 JSON 接口说明(v1)。
本文档描述当前站点提供的 **只读 JSON API**,基础路径为 `/api/v1`。
- 首页已跳转到本页;原 Blade 官网路由仍为 `/product`、`/news` 等。
- 修改或新增接口后,请在项目根目录执行:`php artisan scribe:generate` 以更新文档。
- 亦可下载 Postman 集合:`/docs.postman`,或 OpenAPI:`/docs.openapi`。
<aside>右侧(或移动端内容区)可切换多种语言的请求示例;若需「Try it out」联调,请确保跨域(CORS)已按前端域名配置。</aside>
Authenticating requests
This API is not authenticated.
产品中心
产品增删查改
产品列表
分页返回产品,含分类关联。
Example request:
curl --request GET \
--get "http://api.qyz.com/api/v1/products?page=1&per_page=15" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://api.qyz.com/api/v1/products"
);
const params = {
"page": "1",
"per_page": "15",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "查询产品列表成功",
"data": [
{
"id": 1,
"title": "测试产品",
"product_category_id": null,
"body": "<p><img src=\"http://api.qyz.com/storage/uploads/images/RDBtde3ludzZZKs16staYSIZxkG8SOnVdhSaEw1X.png\" alt=\"图片\" data-href=\"http://api.qyz.com/storage/uploads/images/RDBtde3ludzZZKs16staYSIZxkG8SOnVdhSaEw1X.png\" style=\"\"/>112321312313</p>",
"cover_photo_path": "uploads/images/N3gcYVGZp0xG1EEItHGqTvZbPYiKVO3nRmI8GITf.png",
"summary": "测试摘要",
"author": null,
"date": null,
"created_at": "2026-03-21T01:39:56.000000Z",
"updated_at": "2026-03-21T01:39:56.000000Z"
}
],
"total": 1,
"page": 1,
"per_page": 15,
"code": 200
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
产品详情
Example request:
curl --request GET \
--get "http://api.qyz.com/api/v1/products/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://api.qyz.com/api/v1/products/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"id": 1,
"title": "测试产品",
"product_category_id": null,
"body": "<p><img src=\"http://api.qyz.com/storage/uploads/images/RDBtde3ludzZZKs16staYSIZxkG8SOnVdhSaEw1X.png\" alt=\"图片\" data-href=\"http://api.qyz.com/storage/uploads/images/RDBtde3ludzZZKs16staYSIZxkG8SOnVdhSaEw1X.png\" style=\"\"/>112321312313</p>",
"cover_photo_path": "uploads/images/N3gcYVGZp0xG1EEItHGqTvZbPYiKVO3nRmI8GITf.png",
"summary": "测试摘要",
"author": null,
"date": null,
"created_at": "2026-03-21T01:39:56.000000Z",
"updated_at": "2026-03-21T01:39:56.000000Z",
"product_category": null
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
新增产品
Example request:
curl --request POST \
"http://api.qyz.com/api/v1/products" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"title\": \"智能机器人\",
\"product_category_id\": 1,
\"cover_photo_path\": \"\\/images\\/cover.png\",
\"summary\": \"简介内容\",
\"body\": \"正文内容\",
\"author\": \"张三\",
\"date\": \"2026-03-20\"
}"
const url = new URL(
"http://api.qyz.com/api/v1/products"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"title": "智能机器人",
"product_category_id": 1,
"cover_photo_path": "\/images\/cover.png",
"summary": "简介内容",
"body": "正文内容",
"author": "张三",
"date": "2026-03-20"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
更新产品(POST,body 中带 id,兼容前端)
Example request:
curl --request POST \
"http://api.qyz.com/api/v1/products/update" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"id\": 17,
\"category_id\": 17
}"
const url = new URL(
"http://api.qyz.com/api/v1/products/update"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": 17,
"category_id": 17
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
PUT api/v1/products/{id}
Example request:
curl --request PUT \
"http://api.qyz.com/api/v1/products/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"title\": \"vmqeopfuudtdsufvyvddq\",
\"product_category_id\": 17,
\"cover_photo_path\": \"mqeopfuudtdsufvyvddqa\",
\"summary\": \"mniihfqcoynlazghdtqtq\",
\"body\": \"consequatur\",
\"author\": \"mqeopfuudtdsufvyvddqa\",
\"date\": \"mniihfqcoynlazghdtqtq\"
}"
const url = new URL(
"http://api.qyz.com/api/v1/products/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"title": "vmqeopfuudtdsufvyvddq",
"product_category_id": 17,
"cover_photo_path": "mqeopfuudtdsufvyvddqa",
"summary": "mniihfqcoynlazghdtqtq",
"body": "consequatur",
"author": "mqeopfuudtdsufvyvddqa",
"date": "mniihfqcoynlazghdtqtq"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
删除产品
Example request:
curl --request DELETE \
"http://api.qyz.com/api/v1/products/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://api.qyz.com/api/v1/products/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
产品分类
产品分类增删查改
分类列表
Example request:
curl --request GET \
--get "http://api.qyz.com/api/v1/product_categories?page=1&per_page=15" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://api.qyz.com/api/v1/product_categories"
);
const params = {
"page": "1",
"per_page": "15",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "查询分类列表成功",
"data": [
{
"id": 1,
"name": "测试logo11",
"icon": "uploads/images/Wu5JVNHx4HFxBB3DsHEFbNHDhseMBVUmzer9163u.png",
"created_at": "2026-03-20T08:38:48.000000Z",
"updated_at": "2026-03-20T08:42:54.000000Z"
}
],
"total": 1,
"page": 1,
"per_page": 15,
"code": 200
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
分类详情
Example request:
curl --request GET \
--get "http://api.qyz.com/api/v1/product_categories/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://api.qyz.com/api/v1/product_categories/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"id": 1,
"name": "测试logo11",
"icon": "uploads/images/Wu5JVNHx4HFxBB3DsHEFbNHDhseMBVUmzer9163u.png",
"created_at": "2026-03-20T08:38:48.000000Z",
"updated_at": "2026-03-20T08:42:54.000000Z"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
新增分类
Example request:
curl --request POST \
"http://api.qyz.com/api/v1/product_categories" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"显示器\",
\"icon\": \"\\/images\\/icon.png\"
}"
const url = new URL(
"http://api.qyz.com/api/v1/product_categories"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "显示器",
"icon": "\/images\/icon.png"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
更新分类
Example request:
curl --request POST \
"http://api.qyz.com/api/v1/product_categories/update" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"显示器\",
\"icon\": \"\\/images\\/icon.png\"
}"
const url = new URL(
"http://api.qyz.com/api/v1/product_categories/update"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "显示器",
"icon": "\/images\/icon.png"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
删除分类
Example request:
curl --request DELETE \
"http://api.qyz.com/api/v1/product_categories/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://api.qyz.com/api/v1/product_categories/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
后台认证
后台管理系统登录接口
后台登录
使用邮箱或账号(name)和密码进行登录校验,成功后返回访问令牌(Bearer Token)和用户信息。
Example request:
curl --request POST \
"http://api.qyz.com/api/v1/admin/login" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"login\": \"admin\",
\"email\": \"admin@example.com\",
\"name\": \"admin\",
\"password\": \"123456\"
}"
const url = new URL(
"http://api.qyz.com/api/v1/admin/login"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"login": "admin",
"email": "admin@example.com",
"name": "admin",
"password": "123456"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET api/v1/admin/userlist
Example request:
curl --request GET \
--get "http://api.qyz.com/api/v1/admin/userlist" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://api.qyz.com/api/v1/admin/userlist"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "请求用户信息成功",
"data": {
"total": 1,
"page": 1,
"per_page": 15,
"list": [
{
"id": 1,
"name": "admin",
"email": "admin@example.com"
}
]
},
"code": 200
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/v1/admin/users
Example request:
curl --request POST \
"http://api.qyz.com/api/v1/admin/users" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"vmqeopfuudtdsufvyvddq\",
\"email\": \"kunde.eloisa@example.com\",
\"password\": \"4[*UyPJ\\\"}6\"
}"
const url = new URL(
"http://api.qyz.com/api/v1/admin/users"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "vmqeopfuudtdsufvyvddq",
"email": "kunde.eloisa@example.com",
"password": "4[*UyPJ\"}6"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
PUT api/v1/admin/users/{id}
Example request:
curl --request PUT \
"http://api.qyz.com/api/v1/admin/users/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"vmqeopfuudtdsufvyvddq\",
\"email\": \"kunde.eloisa@example.com\",
\"password\": \"4[*UyPJ\\\"}6\"
}"
const url = new URL(
"http://api.qyz.com/api/v1/admin/users/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "vmqeopfuudtdsufvyvddq",
"email": "kunde.eloisa@example.com",
"password": "4[*UyPJ\"}6"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
图片上传
上传图片并返回可访问的 URL。
图片上传
使用 multipart/form-data 上传文件。
Example request:
curl --request POST \
"http://api.qyz.com/api/v1/upload/image" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "file=@C:\Users\Administrator\AppData\Local\Temp\php9340.tmp" \
--form "image=@C:\Users\Administrator\AppData\Local\Temp\php933F.tmp" const url = new URL(
"http://api.qyz.com/api/v1/upload/image"
);
const headers = {
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('file', document.querySelector('input[name="file"]').files[0]);
body.append('image', document.querySelector('input[name="image"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
新闻资讯
新闻列表与详情(只读)
新闻列表
Example request:
curl --request GET \
--get "http://api.qyz.com/api/v1/news?page=1&per_page=15" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://api.qyz.com/api/v1/news"
);
const params = {
"page": "1",
"per_page": "15",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"current_page": 1,
"data": [],
"first_page_url": "http://api.qyz.com/api/v1/news?page=1",
"from": null,
"last_page": 1,
"last_page_url": "http://api.qyz.com/api/v1/news?page=1",
"links": [
{
"url": null,
"label": "pagination.previous",
"active": false
},
{
"url": "http://api.qyz.com/api/v1/news?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "pagination.next",
"active": false
}
],
"next_page_url": null,
"path": "http://api.qyz.com/api/v1/news",
"per_page": 15,
"prev_page_url": null,
"to": null,
"total": 0
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
新闻详情
Example request:
curl --request GET \
--get "http://api.qyz.com/api/v1/news/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://api.qyz.com/api/v1/news/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "No query results for model [App\\Models\\News] 1"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
案例
案例列表与详情(只读)
案例列表
Example request:
curl --request GET \
--get "http://api.qyz.com/api/v1/anlis?page=1&per_page=15" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://api.qyz.com/api/v1/anlis"
);
const params = {
"page": "1",
"per_page": "15",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"current_page": 1,
"data": [],
"first_page_url": "http://api.qyz.com/api/v1/anlis?page=1",
"from": null,
"last_page": 1,
"last_page_url": "http://api.qyz.com/api/v1/anlis?page=1",
"links": [
{
"url": null,
"label": "pagination.previous",
"active": false
},
{
"url": "http://api.qyz.com/api/v1/anlis?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "pagination.next",
"active": false
}
],
"next_page_url": null,
"path": "http://api.qyz.com/api/v1/anlis",
"per_page": 15,
"prev_page_url": null,
"to": null,
"total": 0
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
案例详情
Example request:
curl --request GET \
--get "http://api.qyz.com/api/v1/anlis/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://api.qyz.com/api/v1/anlis/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "No query results for model [App\\Models\\Anli] 1"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
解决方案
方案列表与详情(只读)
方案列表
Example request:
curl --request GET \
--get "http://api.qyz.com/api/v1/solutions?page=1&per_page=15" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://api.qyz.com/api/v1/solutions"
);
const params = {
"page": "1",
"per_page": "15",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"current_page": 1,
"data": [],
"first_page_url": "http://api.qyz.com/api/v1/solutions?page=1",
"from": null,
"last_page": 1,
"last_page_url": "http://api.qyz.com/api/v1/solutions?page=1",
"links": [
{
"url": null,
"label": "pagination.previous",
"active": false
},
{
"url": "http://api.qyz.com/api/v1/solutions?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "pagination.next",
"active": false
}
],
"next_page_url": null,
"path": "http://api.qyz.com/api/v1/solutions",
"per_page": 15,
"prev_page_url": null,
"to": null,
"total": 0
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
方案详情
Example request:
curl --request GET \
--get "http://api.qyz.com/api/v1/solutions/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://api.qyz.com/api/v1/solutions/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (404):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"message": "No query results for model [App\\Models\\Solution] 1"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.