代码拉取完成,页面将自动刷新
{
"info": {
"_postman_id": "4d91fa03-9e95-4d3d-bd1e-494ad7538a55",
"name": "商城后台",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "21417092"
},
"item": [
{
"name": "用户模块",
"item": [
{
"name": "register",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "user_name",
"value": "xiaobai",
"type": "text"
},
{
"key": "password",
"value": "123456",
"type": "text"
}
]
},
"url": {
"raw": "{{baseURL}}/user/register",
"host": [
"{{baseURL}}"
],
"path": [
"user",
"register"
]
}
},
"response": []
},
{
"name": "login",
"event": [
{
"listen": "test",
"script": {
"exec": [
"\r",
"pm.test(\"Status code is 200\", function () {\r",
" var jsonData = pm.response.json();\r",
" \r",
" pm.collectionVariables.set(\"token\", jsonData.result.token);\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "urlencoded",
"urlencoded": [
{
"key": "user_name",
"value": "xiaojun",
"type": "text"
},
{
"key": "password",
"value": "99999",
"type": "text"
}
]
},
"url": {
"raw": "{{baseURL}}/user/login",
"host": [
"{{baseURL}}"
],
"path": [
"user",
"login"
]
}
},
"response": []
},
{
"name": "changePassword",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6NywidXNlcl9uYW1lIjoieGlhb2p1biIsImlzX2FkbWluIjpmYWxzZSwiaWF0IjoxNjU2OTg4NDk2LCJleHAiOjE2NTcwNzQ4OTZ9.GlsOEuw_KFW8npzH1tQW9c0oImt-hrl_he2x0gV-7r",
"type": "string"
}
]
},
"method": "PATCH",
"header": [],
"body": {
"mode": "urlencoded",
"urlencoded": []
},
"url": {
"raw": "{{baseURL}}/user/",
"host": [
"{{baseURL}}"
],
"path": [
"user",
""
]
}
},
"response": []
}
]
},
{
"name": "商品模块",
"item": [
{
"name": "上传图片",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "file",
"type": "file",
"src": []
}
]
},
"url": {
"raw": "{{baseURL}}/goods/upload",
"host": [
"{{baseURL}}"
],
"path": [
"goods",
"upload"
]
}
},
"response": []
},
{
"name": "发布商品",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n goods_name:'耳机’,\r\n goods_number:10,\r\n goods_price:99,\r\n goods_img:'2f3d00aedc8b12454ebf91b00.jpeg'\r\n}"
},
"url": {
"raw": "{{baseURL}}/goods/publish",
"host": [
"{{baseURL}}"
],
"path": [
"goods",
"publish"
]
}
},
"response": []
},
{
"name": "更新商品",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "PUT",
"header": []
},
"response": []
},
{
"name": "下架商品",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"url": {
"raw": "{{baseURL}}/goods/1/off",
"host": [
"{{baseURL}}"
],
"path": [
"goods",
"1",
"off"
],
"query": [
{
"key": "",
"value": "",
"disabled": true
}
]
}
},
"response": []
},
{
"name": "上架商品",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"url": {
"raw": "{{baseURL}}/goods/1/on",
"host": [
"{{baseURL}}"
],
"path": [
"goods",
"1",
"on"
]
}
},
"response": []
},
{
"name": "获取商品列表",
"request": {
"method": "GET",
"header": []
},
"response": []
}
]
},
{
"name": "购物车模块",
"item": [
{
"name": "添加购物车",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"goods_id\":2,\r\n \"goods_number\":11\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{baseURL}}/carts",
"host": [
"{{baseURL}}"
],
"path": [
"carts"
]
}
},
"response": []
},
{
"name": "获取购物车信息",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"url": {
"raw": "{{baseURL}}/carts/?pageNum=1&pageSize=0",
"host": [
"{{baseURL}}"
],
"path": [
"carts",
""
],
"query": [
{
"key": "pageNum",
"value": "1"
},
{
"key": "pageSize",
"value": "0"
}
]
}
},
"response": []
},
{
"name": "更新购物车",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "PATCH",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"goods_id\":2,\r\n \"goods_number\":100,\r\n \"selected\":false\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{baseURL}}/carts",
"host": [
"{{baseURL}}"
],
"path": [
"carts"
]
}
},
"response": []
},
{
"name": "删除购物车",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "DELETE",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"idList\":[1,2]\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{baseURL}}/carts",
"host": [
"{{baseURL}}"
],
"path": [
"carts"
]
}
},
"response": []
},
{
"name": "全选或取消全选",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "PUT",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"selected\":false\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{baseURL}}/carts",
"host": [
"{{baseURL}}"
],
"path": [
"carts"
]
}
},
"response": []
}
]
},
{
"name": "地址模块",
"item": [
{
"name": "添加收货地址",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"consignee\":\"小熙\",\r\n \"phone\":\"12300000000\",\r\n \"address\":\"地球\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{baseURL}}/address",
"host": [
"{{baseURL}}"
],
"path": [
"address"
]
}
},
"response": []
},
{
"name": "获取收货地址",
"request": {
"method": "GET",
"header": []
},
"response": []
},
{
"name": "修改收货地址",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "PUT",
"header": [],
"body": {
"mode": "raw",
"raw": "{\r\n \"consignee\":\"小明\",\r\n \"phone\":\"12300000001\",\r\n \"address\":\"水星\"\r\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "{{baseURL}}/address/5",
"host": [
"{{baseURL}}"
],
"path": [
"address",
"5"
]
}
},
"response": []
},
{
"name": "删除地址",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{token}}",
"type": "string"
}
]
},
"method": "DELETE",
"header": [],
"url": {
"raw": "{{baseURL}}/address/1",
"host": [
"{{baseURL}}"
],
"path": [
"address",
"1"
]
}
},
"response": []
},
{
"name": "修改默认地址",
"request": {
"method": "GET",
"header": []
},
"response": []
}
]
},
{
"name": "订单模块",
"item": [
{
"name": "创建订单",
"request": {
"method": "GET",
"header": []
},
"response": []
},
{
"name": "获取订单",
"request": {
"method": "GET",
"header": []
},
"response": []
}
]
}
],
"variable": [
{
"key": "token",
"value": ""
}
]
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。