├── .gitignore ├── README.md ├── analogDataSql.sql ├── app.js ├── app ├── controllers │ ├── collectController.js │ ├── orderController.js │ ├── productController.js │ ├── resourcesController.js │ ├── shoppingCartController.js │ └── userController.js ├── middleware │ ├── RewriteUrl.js │ ├── checkLogin.js │ ├── checkUserInfo.js │ ├── error.js │ ├── isLogin.js │ ├── koaBodyConfig.js │ └── session.js ├── models │ └── dao │ │ ├── collectDao.js │ │ ├── db.js │ │ ├── orderDao.js │ │ ├── productDao.js │ │ ├── resourcesDao.js │ │ ├── shoppingCartDao.js │ │ └── userDao.js └── routers │ ├── index.js │ └── router │ ├── collectRouter.js │ ├── orderRouter.js │ ├── productRouter.js │ ├── resourcesRouter.js │ ├── shoppingCartRouter.js │ └── userRouter.js ├── config.js ├── docs └── API.md ├── package-lock.json ├── package.json ├── public ├── docs │ └── README.md └── imgs │ ├── accessory │ ├── accessory-promo1.png │ ├── accessory-promo2.png │ ├── charger-10000mAh.png │ ├── charger-18w.png │ ├── charger-30w.png │ ├── charger-36w.png │ ├── charger-60w.png │ ├── charger-car-37w.png │ ├── charger-car.png │ ├── charger-tio.png │ ├── protectingMen-Mi-CC9.png │ ├── protectingMen-Mi-CC9e.png │ ├── protectingShell-Mi-9-red.png │ ├── protectingShell-Mi-9.png │ ├── protectingShell-Mi-9SE.png │ ├── protectingShell-Mi-CC9Pro.png │ ├── protectingShell-Mix-3.png │ ├── protectingShell-RedMi-K20&pro.png │ └── protectingShell-RedMi-K20.png │ ├── appliance │ ├── AirCondition-F3W1.png │ ├── AirCondition-V1C1.png │ ├── MiTv-4A-32.png │ ├── MiTv-4A-65.png │ ├── MiTv-4C-55.png │ ├── MiTv-4X-43.png │ ├── MiTv-ArtTv-65.png │ ├── MiTv-E55A.png │ ├── MiTv-E65A.png │ ├── Washer-Pro-10.png │ ├── appliance-promo1.png │ └── appliance-promo2.png │ ├── cms_1.jpg │ ├── cms_2.jpg │ ├── cms_3.jpg │ ├── cms_4.jpg │ └── phone │ ├── Mi-CC9.png │ ├── Redmi-7A.png │ ├── Redmi-8.png │ ├── Redmi-8A.png │ ├── Redmi-Note8-pro.png │ ├── Redmi-Note8.png │ ├── Redmi-k30-5G.png │ ├── Redmi-k30.png │ ├── phone.png │ └── picture │ ├── AirCondition-F3W1-1.jpg │ ├── AirCondition-V1C1-1.jpg │ ├── MI CC9 Pro-1.jpg │ ├── MI CC9 Pro-2.jpg │ ├── MI CC9 Pro-3.jpg │ ├── MI CC9 Pro-4.jpg │ ├── MI CC9 Pro-5.jpg │ ├── MI CC9 Pro-6.jpg │ ├── MiTv-4A 65-1.jpg │ ├── MiTv-4A-32-1.jpg │ ├── MiTv-4A-32-2.jpg │ ├── MiTv-4A-32-3.jpg │ ├── MiTv-4A-32-4.jpg │ ├── MiTv-4C 55-1.jpg │ ├── MiTv-4C 55-2.jpg │ ├── MiTv-4C 55-3.jpg │ ├── MiTv-4X 43-1.jpg │ ├── MiTv-4X 43-2.jpg │ ├── MiTv-4X 43-3.jpg │ ├── MiTv-ArtTv-65-1.jpg │ ├── MiTv-E55A-1.jpg │ ├── MiTv-E55A-2.jpg │ ├── MiTv-E55A-3.jpg │ ├── MiTv-E55A-4.jpg │ ├── MiTv-E65A-1.jpg │ ├── MiTv-E65A-2.jpg │ ├── MiTv-E65A-3.jpg │ ├── MiTv-E65A-4.jpg │ ├── Redmi 7A-1.jpg │ ├── Redmi 7A-2.jpg │ ├── Redmi 7A-3.jpg │ ├── Redmi 7A-4.jpg │ ├── Redmi 7A-5.jpg │ ├── Redmi 8-1.jpg │ ├── Redmi 8-2.jpg │ ├── Redmi 8-3.jpg │ ├── Redmi 8-4.jpg │ ├── Redmi 8-5.jpg │ ├── Redmi 8A-1.jpg │ ├── Redmi K30 5G-1.jpg │ ├── Redmi K30 5G-2.jpg │ ├── Redmi K30 5G-3.jpg │ ├── Redmi K30 5G-4.jpg │ ├── Redmi K30 5G-5.jpg │ ├── Redmi Note8 Pro-1.png │ ├── Redmi Note8 Pro-2.png │ ├── Redmi Note8 Pro-3.png │ ├── Redmi Note8 Pro-4.png │ ├── Redmi Note8 Pro-5.png │ ├── Redmi Note8-1.jpg │ ├── Redmi Note8-2.jpg │ ├── Redmi Note8-3.jpg │ ├── Redmi Note8-4.jpg │ ├── Redmi Note8-5.jpg │ ├── Redmi-k30-1.png │ ├── Redmi-k30-2.png │ ├── Redmi-k30-3.png │ ├── Redmi-k30-4.png │ ├── Redmi-k30-5.png │ ├── Washer-Pro-10-1.jpg │ ├── Washer-Pro-10-2.jpg │ ├── Washer-Pro-10-3.jpg │ ├── Washer-Pro-10-4.jpg │ ├── charger-10000mAh-1.jpg │ ├── charger-10000mAh-2.jpg │ ├── charger-10000mAh-3.jpg │ ├── charger-10000mAh-4.jpg │ ├── charger-10000mAh-5.jpg │ ├── charger-18w-1.jpg │ ├── charger-18w-2.jpg │ ├── charger-18w-3.jpg │ ├── charger-30w-1.jpg │ ├── charger-30w-2.jpg │ ├── charger-30w-3.jpg │ ├── charger-30w-4.jpg │ ├── charger-36w-1.jpg │ ├── charger-36w-2.jpg │ ├── charger-36w-3.jpg │ ├── charger-36w-4.jpg │ ├── charger-36w-5.jpg │ ├── charger-60w-1.jpg │ ├── charger-60w-2.jpg │ ├── charger-60w-3.jpg │ ├── charger-60w-4.jpg │ ├── charger-car-1.jpg │ ├── charger-car-2.jpg │ ├── charger-car-3.jpg │ ├── charger-car-37w-1.jpg │ ├── charger-car-37w-2.jpg │ ├── charger-car-37w-3.jpg │ ├── charger-car-37w-4.jpg │ ├── charger-car-37w-5.jpg │ ├── charger-car-4.jpg │ ├── charger-car-5.jpg │ ├── charger-car-6.jpg │ ├── charger-tio-1.jpg │ ├── charger-tio-2.jpg │ ├── charger-tio-3.jpg │ ├── charger-tio-4.jpg │ ├── charger-tio-5.jpg │ ├── protectingMen-Mi-CC9-1.jpg │ ├── protectingMen-Mi-CC9e-1.jpg │ ├── protectingShell-Mi-9-1.jpg │ ├── protectingShell-Mi-9-2.jpg │ ├── protectingShell-Mi-9-red-1.jpg │ ├── protectingShell-Mi-9SE-1.jpg │ ├── protectingShell-Mi-CC9Pro-1.jpg │ ├── protectingShell-Mix-3-1.jpg │ ├── protectingShell-RedMi-K20&pro-1.jpg │ └── protectingShell-RedMi-K20-1.jpg ├── sql ├── product.sql └── product_picture.sql └── storeDB.sql /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # store-server 2 | 3 | ## 前言 4 | 5 | 2020年寒假尤其特殊,因为新型冠状病毒肺炎疫情,学校至今没有开学。想起上学期利用课余时间学习了`vue`、`node.js`,一直想做个完整的项目实战一下,但之前在学校并没有那么多的时间。现在恰好有时间,就想着做一个项目巩固之前学到的东西。 6 | 7 | 本项目前后端分离,这是项目的后端,前端请移步[vue-store](https://github.com/hai-27/vue-store)。 8 | 9 | ## 接口文档 10 | 11 | [接口文档](https://github.com/hai-27/store-server/blob/master/docs/API.md) 12 | 13 | ## 运行项目 14 | ``` 15 | 1. Clone project 16 | 17 | git clone https://github.com/hai-27/store-server.git 18 | 19 | 2. Project setup 20 | 21 | cd store-server 22 | npm install 23 | 24 | 3. Run project 25 | 26 | node app.js 27 | ``` 28 | -------------------------------------------------------------------------------- /analogDataSql.sql: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 插入模拟的数据库信息语句 3 | * @Author: hai-27 4 | * @Date: 2020-02-09 14:40:32 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-02-25 22:39:16 7 | */ 8 | insert into category 9 | values(null, "手机"); 10 | 11 | insert into category 12 | values(null, "电视机"); 13 | insert into category 14 | values(null, "空调"); 15 | insert into category 16 | values(null, "洗衣机"); 17 | 18 | insert into category 19 | values(null, "保护套"); 20 | insert into category 21 | values(null, "保护膜"); 22 | insert into category 23 | values(null, "充电器"); 24 | insert into category 25 | values(null, "充电宝"); 26 | 27 | 28 | insert into product 29 | values 30 | (null, 'Redmi K30', 1, '120Hz流速屏,全速热爱', '120Hz高帧率流速屏/ 索尼6400万前后六摄 / 6.67''小孔径全面屏 / 最高可选8GB+256GB大存储 / 高通骁龙730G处理器 / 3D四曲面玻璃机身 / 4500mAh+27W快充 / 多功能NFC', 'public/imgs/phone/Redmi-k30.png', 2000.00, 1599.00, 10, 0), 31 | (null, 'Redmi K30 5G', 1, '双模5G,120Hz流速屏', '双模5G / 三路并发 / 高通骁龙765G / 7nm 5G低功耗处理器 / 120Hz高帧率流速屏 / 6.67''小孔径全面屏 / 索尼6400万前后六摄 / 最高可选8GB+256GB大存储 / 4500mAh+30W快充 / 3D四曲面玻璃机身 / 多功能NFC', 'public/imgs/phone/Redmi-k30-5G.png', 2599.00, 2599.00, 10, 0), 32 | (null, '小米CC9 Pro', 1, '1亿像素,五摄四闪', '1亿像素主摄 / 全场景五摄像头 / 四闪光灯 / 3200万自拍 / 10 倍混合光学变焦,50倍数字变焦 / 5260mAh ⼤电量 / 标配 30W疾速快充 / ⼩米⾸款超薄屏下指纹 / 德国莱茵低蓝光认证 / 多功能NFC / 红外万能遥控 / 1216超线性扬声器', 'public/imgs/phone/Mi-CC9.png', 2799.00, 2599.00, 20, 0), 33 | (null, 'Redmi 8', 1, '5000mAh超长续航', '5000mAh超长续航 / 高通骁龙439八核处理器 / 4GB+64GB', 'public/imgs/phone/Redmi-8.png', 799.00, 699.00, 20, 0), 34 | (null, 'Redmi 8A', 1, '5000mAh超长续航', '5000mAh超长续航 / 高通骁龙439八核处理器 / 4GB+64GB / 1200万AI后置相机', 'public/imgs/phone/Redmi-8A.png', 599.00, 699.00, 20, 0), 35 | (null, 'Redmi Note8 Pro', 1, '6400万全场景四摄', '6400万四摄小金刚拍照新旗舰超强解析力,超震撼', 'public/imgs/phone/Redmi-Note8-pro.png', 1399.00, 1199.00, 20, 0), 36 | (null, 'Redmi Note8', 1, '千元4800万四摄', '千元4800万四摄 | 高通骁龙665 | 小金刚品质保证', 'public/imgs/phone/Redmi-Note8.png', 999.00, 999.00, 20, 0), 37 | (null, 'Redmi 7A', 1, '小巧大电量 持久流畅', '小巧大电量,持久又流畅骁龙8核高性能处理器 | 4000mAh超长续航 | AI人脸解锁 | 整机防泼溅', 'public/imgs/phone/Redmi-7A.png', 599.00, 539.00, 20, 0); 38 | 39 | insert into product 40 | values 41 | (null, '小米电视4A 32英寸', 2, '人工智能系统,高清液晶屏', '小米电视4A 32英寸 | 64位四核处理器 | 1GB+4GB大内存 | 人工智能系统', 'public/imgs/appliance/MiTv-4A-32.png', 799.00, 799.00, 10, 0), 42 | (null, '小米全面屏电视E55A', 2, '全面屏设计,人工智能语音', '全面屏设计 | 内置小爱同学 | 4K + HDR | 杜比DTS | PatchWall | 海量内容 | 2GB + 8GB大存储 | 64位四核处理器', 'public/imgs/appliance/MiTv-E55A.png', 2099.00, 1899.00, 10, 0), 43 | (null, '小米全面屏电视E65A', 2, '全面屏设计,人工智能语音', '人工智能语音系统 | 海量影视内容 | 4K 超高清屏 | 杜比音效 | 64位四核处理器 | 2GB + 8GB大存储', 'public/imgs/appliance/MiTv-E65A.png', 3999.00, 2799.00, 10, 0), 44 | (null, '小米电视4X 43英寸', 2, 'FHD全高清屏,人工智能语音', '人工智能语音系统 | FHD全高清屏 | 64位四核处理器 | 海量片源 | 1GB+8GB大内存 | 钢琴烤漆', 'public/imgs/appliance/MiTv-4X-43.png', 1499.00, 1299.00, 10, 0), 45 | (null, '小米电视4C 55英寸', 2, '4K HDR,人工智能系统', '人工智能 | 大内存 | 杜比音效 | 超窄边 | 4K HDR | 海量片源 | 纤薄机身| 钢琴烤漆', 'public/imgs/appliance/MiTv-4C-55.png', 1999.00, 1799.00, 10, 0), 46 | (null, '小米电视4A 65英寸', 2, '4K HDR,人工智能系统', '人工智能 | 大内存 | 杜比音效 | 超窄边 | 4K HDR | 海量片源 | 纤薄机身| 钢琴烤漆', 'public/imgs/appliance/MiTv-4A-65.png', 2999.00, 2799.00, 10, 0), 47 | (null, '小米壁画电视 65英寸', 2, '壁画外观,全面屏,远场语音', '纯平背板 | 通体13.9mm | 远场语音 | 4K+HDR | 杜比+DTS | 画框模式 | 内置小爱同学 | PatchWall | SoundBar+低音炮 | 四核处理器+大存储', 'public/imgs/appliance/MiTv-ArtTv-65.png', 6999.00, 6999.00, 10, 0); 48 | 49 | insert into product 50 | values 51 | (null, '米家互联网空调C1(一级能效)', 3, '变频节能省电,自清洁', '一级能效 | 1.5匹 | 全直流变频 | 高效制冷/热 | 静音设计 | 自清洁 | 全屋互联', 'public/imgs/appliance/AirCondition-V1C1.png', 2699.00, 2599.00, 20, 10), 52 | (null, '米家空调', 3, '出众静音,快速制冷热', '大1匹 | 三级能效 | 静音 | 快速制冷热 | 广角送风 | 除湿功能 | 高密度过滤网 | 典雅外观', 'public/imgs/appliance/AirCondition-F3W1.png', 1799.00, 1699.00, 20, 8); 53 | 54 | insert into product 55 | values 56 | (null, '米家互联网洗烘一体机 Pro 10kg', 4, '智能洗烘,省心省力', '国标双A+级洗烘能力 / 22种洗烘模式 / 智能投放洗涤剂 / 支持小爱同学语音遥控 / 支持OTA在线智能升级 / 智能空气洗 / 除菌率达99.9%+', 'public/imgs/appliance/Washer-Pro-10.png', 2999.00, 2999.00, 20, 7); 57 | 58 | insert into product 59 | values 60 | (null, 'Redmi K20/ K20 Pro 怪力魔王保护壳', 5, '怪力魔王专属定制', '优选PC材料,强韧张力,经久耐用 / 精选开孔,全面贴合机身 / 手感轻薄细腻,舒适无负担 / 三款颜色可选,彰显个性,与众不同', 'public/imgs/accessory/protectingShell-RedMi-K20&pro.png', 39.00, 39.00, 20, 10), 61 | (null, '小米9 ARE U OK保护壳', 5, '一个与众不同的保护壳', '彰显独特个性 / 轻薄无负担 / 优选PC材料 / 贴合机身 / 潮流五色', 'public/imgs/accessory/protectingShell-Mi-9.png', 49.00, 39.00, 20, 10); 62 | 63 | insert into product 64 | values 65 | (null, '小米CC9&小米CC9美图定制版 标准高透贴膜', 6, '高清透亮,耐磨性强', '耐磨性强,防护更出众 / 疏油疏水,有效抗水抗脏污 / 高清透亮,保留了原生屏幕的亮丽颜色和清晰度 / 操作灵敏,智能吸附 / 进口高端PET材质,裸机般手感', 'public/imgs/accessory/protectingMen-Mi-CC9.png', 19.00, 19.00, 20, 9), 66 | (null, '小米CC9e 标准高透贴膜', 6, '高清透亮,耐磨性强', '耐磨性强,防护更出众 / 疏油疏水,有效抗水抗脏污 / 高清透亮,保留了原生屏幕的亮丽颜色和清晰度 / 操作灵敏,智能吸附 / 进口高端PET材质,裸机般手感', 'public/imgs/accessory/protectingMen-Mi-CC9e.png', 19.00, 19.00, 20, 9); 67 | 68 | insert into product 69 | values 70 | (null, '小米USB充电器30W快充版(1A1C)', 7, '多一种接口,多一种选择', '双口输出 / 30W 输出 / 可折叠插脚 / 小巧便携', 'public/imgs/accessory/charger-30w.png', 59.00, 59.00, 20, 8), 71 | (null, '小米USB充电器快充版(18W)', 7, '安卓、苹果设备均可使用', '支持QC3.0设备充电 / 支持iOS设备充电/ 美观耐用', 'public/imgs/accessory/charger-18w.png', 29.00, 29.00, 20, 8), 72 | (null, '小米USB充电器60W快充版(6口)', 7, '6口输出,USB-C输出接口', '6口输出 / USB-C输出接口 / 支持QC3.0快充协议 / 总输出功率60W', 'public/imgs/accessory/charger-60w.png', 129.00, 129.00, 20, 0), 73 | (null, '小米USB充电器36W快充版(2口)', 7, '6多重安全保护,小巧便携', '双USB输出接口 / 支持QC3.0快充协议 / 多重安全保护 / 小巧便携', 'public/imgs/accessory/charger-36w.png', 59.00, 59.00, 20, 0), 74 | (null, '小米车载充电器快充版', 7, '让爱车成为移动充电站', 'QC3.0 双口输出 / 智能温度控制 / 5重安全保护 / 兼容iOS&Android设备', 'public/imgs/accessory/charger-car.png', 69.00, 69.00, 20, 0), 75 | (null, '小米车载充电器快充版(37W)', 7, '双口快充,车载充电更安全', '单口27W 快充 / 双口输出 / 多重安全保护', 'public/imgs/accessory/charger-car-37w.png', 49.00, 49.00, 20, 0), 76 | (null, '小米二合一移动电源(充电器)', 7, '一个设备多种用途', '5000mAh充沛电量 / 多协议快充 / USB 口输出', 'public/imgs/accessory/charger-tio.png', 99.00, 99.00, 20, 0); 77 | 78 | insert into product 79 | values 80 | (null, '小米无线充电宝青春版10000mAh', 8, '能量满满,无线有线都能充', '10000mAh大容量 / 支持边充边放 / 有线无线都能充 / 双向快充', 'public/imgs/accessory/charger-10000mAh.png', 129.00, 129.00, 20, 8); 81 | 82 | insert into product 83 | values 84 | (null, '小米CC9 Pro/尊享版 撞色飘带保护壳', 5, '全面贴合,无感更舒适', '优选环保PC材质,强韧张力,全面贴合,无感更舒适', 'public/imgs/accessory/protectingShell-Mi-CC9Pro.png', 69.00, 69.00, 20, 0), 85 | (null, 'Redmi K20系列 幻境之心保护壳', 5, '柔软坚韧,全面贴合', '优质环保材质,柔软坚韧 / 全面贴合,有效抵抗灰尘 / 鲜亮三种颜色可选,为爱机随时换装', 'public/imgs/accessory/protectingShell-RedMi-K20.png', 39.00, 39.00, 20, 0), 86 | (null, '小米9 SE 街头风保护壳黑色', 5, '个性时尚,细节出众', '个性时尚 / 细节出众 / 纤薄轻巧 / 多彩时尚', 'public/imgs/accessory/protectingShell-Mi-9SE.png', 49.00, 49.00, 20, 0), 87 | (null, '小米9 街头风保护壳 红色', 5, '个性时尚,细节出众', '时尚多彩 / 细节出众 / 纤薄轻巧 / 是腕带也是支架', 'public/imgs/accessory/protectingShell-Mi-9-red.png', 49.00, 49.00, 20, 0), 88 | (null, '小米MIX 3 极简保护壳蓝色', 5, '时尚简约设计,手感细腻顺滑', '时尚简约设计,手感细腻顺滑 / 优质环保PC原材料,强韧张力,经久耐用 / 超薄 0.8MM厚度', 'public/imgs/accessory/protectingShell-Mix-3.png', 49.00, 12.90, 20, 0); 89 | 90 | insert into product_picture 91 | values 92 | (null, 1, "public/imgs/phone/picture/Redmi-k30-1.png", null), 93 | (null, 1, "public/imgs/phone/picture/Redmi-k30-2.png", null), 94 | (null, 1, "public/imgs/phone/picture/Redmi-k30-3.png", null), 95 | (null, 1, "public/imgs/phone/picture/Redmi-k30-4.png", null), 96 | (null, 1, "public/imgs/phone/picture/Redmi-k30-5.png", null); 97 | 98 | insert into product_picture 99 | values 100 | (null, 2, "public/imgs/phone/picture/Redmi K30 5G-1.jpg", null), 101 | (null, 2, "public/imgs/phone/picture/Redmi K30 5G-2.jpg", null), 102 | (null, 2, "public/imgs/phone/picture/Redmi K30 5G-3.jpg", null), 103 | (null, 2, "public/imgs/phone/picture/Redmi K30 5G-4.jpg", null), 104 | (null, 2, "public/imgs/phone/picture/Redmi K30 5G-5.jpg", null); 105 | 106 | insert into product_picture 107 | values 108 | (null, 3, "public/imgs/phone/picture/MI CC9 Pro-1.jpg", null), 109 | (null, 3, "public/imgs/phone/picture/MI CC9 Pro-2.jpg", null), 110 | (null, 3, "public/imgs/phone/picture/MI CC9 Pro-3.jpg", null), 111 | (null, 3, "public/imgs/phone/picture/MI CC9 Pro-4.jpg", null), 112 | (null, 3, "public/imgs/phone/picture/MI CC9 Pro-5.jpg", null), 113 | (null, 3, "public/imgs/phone/picture/MI CC9 Pro-6.jpg", null); 114 | 115 | insert into product_picture 116 | values 117 | (null, 4, "public/imgs/phone/picture/Redmi 8-1.jpg", null), 118 | (null, 4, "public/imgs/phone/picture/Redmi 8-2.jpg", null), 119 | (null, 4, "public/imgs/phone/picture/Redmi 8-3.jpg", null), 120 | (null, 4, "public/imgs/phone/picture/Redmi 8-4.jpg", null), 121 | (null, 4, "public/imgs/phone/picture/Redmi 8-5.jpg", null); 122 | 123 | insert into product_picture 124 | values 125 | (null, 5, "public/imgs/phone/picture/Redmi 8A-1.jpg", null); 126 | 127 | insert into product_picture 128 | values 129 | (null, 6, "public/imgs/phone/picture/Redmi Note8 Pro-1.png", null), 130 | (null, 6, "public/imgs/phone/picture/Redmi Note8 Pro-2.png", null), 131 | (null, 6, "public/imgs/phone/picture/Redmi Note8 Pro-3.png", null), 132 | (null, 6, "public/imgs/phone/picture/Redmi Note8 Pro-4.png", null), 133 | (null, 6, "public/imgs/phone/picture/Redmi Note8 Pro-5.png", null); 134 | 135 | insert into product_picture 136 | values 137 | (null, 7, "public/imgs/phone/picture/Redmi Note8-1.jpg", null), 138 | (null, 7, "public/imgs/phone/picture/Redmi Note8-2.jpg", null), 139 | (null, 7, "public/imgs/phone/picture/Redmi Note8-3.jpg", null), 140 | (null, 7, "public/imgs/phone/picture/Redmi Note8-4.jpg", null), 141 | (null, 7, "public/imgs/phone/picture/Redmi Note8-5.jpg", null); 142 | 143 | insert into product_picture 144 | values 145 | (null, 8, "public/imgs/phone/picture/Redmi 7A-1.jpg", null), 146 | (null, 8, "public/imgs/phone/picture/Redmi 7A-2.jpg", null), 147 | (null, 8, "public/imgs/phone/picture/Redmi 7A-3.jpg", null), 148 | (null, 8, "public/imgs/phone/picture/Redmi 7A-4.jpg", null), 149 | (null, 8, "public/imgs/phone/picture/Redmi 7A-5.jpg", null); 150 | 151 | insert into product_picture 152 | values 153 | (null, 9, "public/imgs/phone/picture/MiTv-4A-32-1.jpg", null), 154 | (null, 9, "public/imgs/phone/picture/MiTv-4A-32-2.jpg", null), 155 | (null, 9, "public/imgs/phone/picture/MiTv-4A-32-3.jpg", null), 156 | (null, 9, "public/imgs/phone/picture/MiTv-4A-32-4.jpg", null); 157 | 158 | insert into product_picture 159 | values 160 | (null, 10, "public/imgs/phone/picture/MiTv-E55A-1.jpg", null), 161 | (null, 10, "public/imgs/phone/picture/MiTv-E55A-2.jpg", null), 162 | (null, 10, "public/imgs/phone/picture/MiTv-E55A-3.jpg", null), 163 | (null, 10, "public/imgs/phone/picture/MiTv-E55A-4.jpg", null); 164 | 165 | insert into product_picture 166 | values 167 | (null, 11, "public/imgs/phone/picture/MiTv-E65A-1.jpg", null), 168 | (null, 11, "public/imgs/phone/picture/MiTv-E65A-2.jpg", null), 169 | (null, 11, "public/imgs/phone/picture/MiTv-E65A-3.jpg", null), 170 | (null, 11, "public/imgs/phone/picture/MiTv-E65A-4.jpg", null); 171 | 172 | insert into product_picture 173 | values 174 | (null, 12, "public/imgs/phone/picture/MiTv-4X 43-1.jpg", null), 175 | (null, 12, "public/imgs/phone/picture/MiTv-4X 43-2.jpg", null), 176 | (null, 12, "public/imgs/phone/picture/MiTv-4X 43-3.jpg", null); 177 | 178 | insert into product_picture 179 | values 180 | (null, 13, "public/imgs/phone/picture/MiTv-4C 55-1.jpg", null), 181 | (null, 13, "public/imgs/phone/picture/MiTv-4C 55-2.jpg", null), 182 | (null, 13, "public/imgs/phone/picture/MiTv-4C 55-3.jpg", null); 183 | 184 | insert into product_picture 185 | values 186 | (null, 14, "public/imgs/phone/picture/MiTv-4A 65-1.jpg", null); 187 | 188 | insert into product_picture 189 | values 190 | (null, 15, "public/imgs/phone/picture/MiTv-ArtTv-65-1.jpg", null); 191 | 192 | insert into product_picture 193 | values 194 | (null, 16, "public/imgs/phone/picture/AirCondition-V1C1-1.jpg", null); 195 | 196 | insert into product_picture 197 | values 198 | (null, 17, "public/imgs/phone/picture/AirCondition-F3W1-1.jpg", null); 199 | 200 | insert into product_picture 201 | values 202 | (null, 18, "public/imgs/phone/picture/Washer-Pro-10-1.jpg", null), 203 | (null, 18, "public/imgs/phone/picture/Washer-Pro-10-2.jpg", null), 204 | (null, 18, "public/imgs/phone/picture/Washer-Pro-10-3.jpg", null), 205 | (null, 18, "public/imgs/phone/picture/Washer-Pro-10-4.jpg", null); 206 | 207 | insert into product_picture 208 | values 209 | (null, 19, "public/imgs/phone/picture/protectingShell-RedMi-K20&pro-1.jpg", null); 210 | 211 | insert into product_picture 212 | values 213 | (null, 20, "public/imgs/phone/picture/protectingShell-Mi-9-1.jpg", null), 214 | (null, 20, "public/imgs/phone/picture/protectingShell-Mi-9-2.jpg", null); 215 | 216 | insert into product_picture 217 | values 218 | (null, 21, "public/imgs/phone/picture/protectingMen-Mi-CC9-1.jpg", null); 219 | 220 | insert into product_picture 221 | values 222 | (null, 22, "public/imgs/phone/picture/protectingMen-Mi-CC9e-1.jpg", null); 223 | 224 | insert into product_picture 225 | values 226 | (null, 23, "public/imgs/phone/picture/charger-30w-1.jpg", null), 227 | (null, 23, "public/imgs/phone/picture/charger-30w-2.jpg", null), 228 | (null, 23, "public/imgs/phone/picture/charger-30w-3.jpg", null), 229 | (null, 23, "public/imgs/phone/picture/charger-30w-4.jpg", null); 230 | 231 | insert into product_picture 232 | values 233 | (null, 24, "public/imgs/phone/picture/charger-18w-1.jpg", null), 234 | (null, 24, "public/imgs/phone/picture/charger-18w-2.jpg", null), 235 | (null, 24, "public/imgs/phone/picture/charger-18w-3.jpg", null); 236 | 237 | insert into product_picture 238 | values 239 | (null, 25, "public/imgs/phone/picture/charger-60w-1.jpg", null), 240 | (null, 25, "public/imgs/phone/picture/charger-60w-2.jpg", null), 241 | (null, 25, "public/imgs/phone/picture/charger-60w-3.jpg", null), 242 | (null, 25, "public/imgs/phone/picture/charger-60w-4.jpg", null); 243 | 244 | insert into product_picture 245 | values 246 | (null, 26, "public/imgs/phone/picture/charger-36w-1.jpg", null), 247 | (null, 26, "public/imgs/phone/picture/charger-36w-2.jpg", null), 248 | (null, 26, "public/imgs/phone/picture/charger-36w-3.jpg", null), 249 | (null, 26, "public/imgs/phone/picture/charger-36w-4.jpg", null), 250 | (null, 26, "public/imgs/phone/picture/charger-36w-5.jpg", null); 251 | 252 | insert into product_picture 253 | values 254 | (null, 27, "public/imgs/phone/picture/charger-car-1.jpg", null), 255 | (null, 27, "public/imgs/phone/picture/charger-car-2.jpg", null), 256 | (null, 27, "public/imgs/phone/picture/charger-car-3.jpg", null), 257 | (null, 27, "public/imgs/phone/picture/charger-car-4.jpg", null), 258 | (null, 27, "public/imgs/phone/picture/charger-car-5.jpg", null), 259 | (null, 27, "public/imgs/phone/picture/charger-car-6.jpg", null); 260 | 261 | insert into product_picture 262 | values 263 | (null, 28, "public/imgs/phone/picture/charger-car-37w-1.jpg", null), 264 | (null, 28, "public/imgs/phone/picture/charger-car-37w-2.jpg", null), 265 | (null, 28, "public/imgs/phone/picture/charger-car-37w-3.jpg", null), 266 | (null, 28, "public/imgs/phone/picture/charger-car-37w-4.jpg", null), 267 | (null, 28, "public/imgs/phone/picture/charger-car-37w-5.jpg", null); 268 | 269 | insert into product_picture 270 | values 271 | (null, 29, "public/imgs/phone/picture/charger-tio-1.jpg", null), 272 | (null, 29, "public/imgs/phone/picture/charger-tio-2.jpg", null), 273 | (null, 29, "public/imgs/phone/picture/charger-tio-3.jpg", null), 274 | (null, 29, "public/imgs/phone/picture/charger-tio-4.jpg", null), 275 | (null, 29, "public/imgs/phone/picture/charger-tio-5.jpg", null); 276 | 277 | insert into product_picture 278 | values 279 | (null, 30, "public/imgs/phone/picture/charger-10000mAh-1.jpg", null), 280 | (null, 30, "public/imgs/phone/picture/charger-10000mAh-2.jpg", null), 281 | (null, 30, "public/imgs/phone/picture/charger-10000mAh-3.jpg", null), 282 | (null, 30, "public/imgs/phone/picture/charger-10000mAh-4.jpg", null), 283 | (null, 30, "public/imgs/phone/picture/charger-10000mAh-5.jpg", null); 284 | 285 | insert into product_picture 286 | values 287 | (null, 31, "public/imgs/phone/picture/protectingShell-Mi-CC9Pro-1.jpg", null); 288 | 289 | insert into product_picture 290 | values 291 | (null, 32, "public/imgs/phone/picture/protectingShell-RedMi-K20-1.jpg", null); 292 | 293 | insert into product_picture 294 | values 295 | (null, 33, "public/imgs/phone/picture/protectingShell-Mi-9SE-1.jpg", null); 296 | 297 | insert into product_picture 298 | values 299 | (null, 34, "public/imgs/phone/picture/protectingShell-Mi-9-red-1.jpg", null); 300 | 301 | insert into product_picture 302 | values 303 | (null, 35, "public/imgs/phone/picture/protectingShell-Mix-3-1.jpg", null); -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Author: hai-27 3 | * @Date: 2020-02-07 16:51:56 4 | * @LastEditors: hai-27 5 | * @LastEditTime: 2020-04-07 23:40:51 6 | */ 7 | const Koa = require('koa'); 8 | const KoaStatic = require('koa-static'); 9 | const KoaBody = require('koa-body'); 10 | const Session = require('koa-session'); 11 | 12 | let { Port, staticDir } = require('./config'); 13 | 14 | let app = new Koa(); 15 | 16 | // 处理异常 17 | const error = require('./app/middleware/error'); 18 | app.use(error); 19 | 20 | // 为静态资源请求重写url 21 | const rewriteUrl = require('./app/middleware/rewriteUrl'); 22 | app.use(rewriteUrl); 23 | // 使用koa-static处理静态资源 24 | app.use(KoaStatic(staticDir)); 25 | 26 | // session 27 | const CONFIG = require('./app/middleware/session'); 28 | app.keys = ['session app keys']; 29 | app.use(Session(CONFIG, app)); 30 | 31 | // 判断是否登录 32 | const isLogin = require('./app/middleware/isLogin'); 33 | app.use(isLogin); 34 | 35 | app.use(async (ctx, next) => { 36 | ctx.state.user = ctx.session.user; 37 | await next(); 38 | }); 39 | 40 | // 处理请求体数据 41 | const koaBodyConfig = require('./app/middleware/koaBodyConfig'); 42 | app.use(KoaBody(koaBodyConfig)); 43 | 44 | // 使用路由中间件 45 | const Routers = require('./app/routers'); 46 | app.use(Routers.routes()).use(Routers.allowedMethods()); 47 | 48 | app.listen(Port, () => { 49 | console.log(`服务器启动在${ Port }端口`); 50 | }); -------------------------------------------------------------------------------- /app/controllers/collectController.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 我的收藏模块控制器 3 | * @Author: hai-27 4 | * @Date: 2020-03-04 22:30:31 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-03-04 23:32:23 7 | */ 8 | const collectDao = require('../models/dao/collectDao'); 9 | const productDao = require('../models/dao/productDao'); 10 | const checkLogin = require('../middleware/checkLogin'); 11 | 12 | module.exports = { 13 | /** 14 | * 添加收藏 15 | * @param {Object} ctx 16 | */ 17 | AddCollect: async ctx => { 18 | let { user_id, product_id } = ctx.request.body; 19 | 20 | // 校验用户是否登录 21 | if (!checkLogin(ctx, user_id)) { 22 | return; 23 | } 24 | 25 | // 判断该用户的收藏列表是否存在该商品 26 | let tempCollect = await collectDao.FindCollect(user_id, product_id); 27 | 28 | if (tempCollect.length > 0) { 29 | ctx.body = { 30 | code: '003', 31 | msg: '该商品已经添加收藏,请到我的收藏查看' 32 | } 33 | return; 34 | } 35 | 36 | // 获取当前时间戳 37 | const timeTemp = new Date().getTime(); 38 | try { 39 | // 把收藏商品信息插入数据库 40 | const result = await collectDao.AddCollect(user_id, product_id, timeTemp); 41 | // 插入成功 42 | if (result.affectedRows === 1) { 43 | ctx.body = { 44 | code: '001', 45 | msg: '添加收藏成功' 46 | } 47 | return; 48 | } 49 | } catch (error) { 50 | reject(error); 51 | } 52 | 53 | ctx.body = { 54 | code: '002', 55 | msg: '添加收藏失败' 56 | } 57 | }, 58 | /** 59 | * 获取用户的所有收藏商品信息 60 | * @param {Object} ctx 61 | */ 62 | GetCollect: async ctx => { 63 | let { user_id } = ctx.request.body; 64 | // 校验用户是否登录 65 | if (!checkLogin(ctx, user_id)) { 66 | return; 67 | } 68 | // 获取所有收藏信息 69 | const collect = await collectDao.GetCollect(user_id); 70 | 71 | // 该用户没有收藏的商品,直接返回信息 72 | if (collect.length == 0) { 73 | ctx.body = { 74 | code: '002', 75 | msg: '该用户没有收藏的商品' 76 | } 77 | return; 78 | } 79 | 80 | let collectList = []; 81 | // 生成收藏商品的详细信息列表 82 | for (let i = 0; i < collect.length; i++) { 83 | const temp = collect[i]; 84 | // 获取每个商品详细信息 85 | const product = await productDao.GetProductById(temp.product_id); 86 | collectList.push(product[0]); 87 | } 88 | 89 | ctx.body = { 90 | code: '001', 91 | collectList: collectList 92 | } 93 | }, 94 | /** 95 | * 删除用户的收藏商品信息 96 | * @param {Object} ctx 97 | */ 98 | DeleteCollect: async ctx => { 99 | let { user_id, product_id } = ctx.request.body; 100 | // 校验用户是否登录 101 | if (!checkLogin(ctx, user_id)) { 102 | return; 103 | } 104 | 105 | // 判断该用户的收藏列表是否存在该商品 106 | let tempCollect = await collectDao.FindCollect(user_id, product_id); 107 | 108 | if (tempCollect.length > 0) { 109 | // 如果存在则删除 110 | try { 111 | const result = await collectDao.DeleteCollect(user_id, product_id); 112 | // 判断是否删除成功 113 | if (result.affectedRows === 1) { 114 | ctx.body = { 115 | code: '001', 116 | msg: '删除收藏成功' 117 | } 118 | return; 119 | } 120 | } catch (error) { 121 | reject(error); 122 | } 123 | } else { 124 | // 不存在则返回信息 125 | ctx.body = { 126 | code: '002', 127 | msg: '该商品不在收藏列表' 128 | } 129 | } 130 | } 131 | } -------------------------------------------------------------------------------- /app/controllers/orderController.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 订单模块控制器 3 | * @Author: hai-27 4 | * @Date: 2020-02-24 16:35:22 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-02-27 14:32:16 7 | */ 8 | const orderDao = require('../models/dao/orderDao'); 9 | const shoppingCartDao = require('../models/dao/shoppingCartDao'); 10 | const productDao = require('../models/dao/productDao'); 11 | const checkLogin = require('../middleware/checkLogin'); 12 | 13 | module.exports = { 14 | /** 15 | * 获取用户的所有订单信息 16 | * @param {Object} ctx 17 | */ 18 | GetOrder: async ctx => { 19 | let { user_id } = ctx.request.body; 20 | // 校验用户是否登录 21 | if (!checkLogin(ctx, user_id)) { 22 | return; 23 | } 24 | // 获取所有的订单id 25 | const ordersGroup = await orderDao.GetOrderGroup(user_id); 26 | 27 | // 该用户没有订单,直接返回信息 28 | if (ordersGroup.length == 0) { 29 | ctx.body = { 30 | code: '002', 31 | msg: '该用户没有订单信息' 32 | } 33 | return; 34 | } 35 | 36 | // 获取所有的订单详细信息 37 | const orders = await orderDao.GetOrder(user_id); 38 | 39 | let ordersList = []; 40 | // 生成每个订单的详细信息列表 41 | for (let i = 0; i < ordersGroup.length; i++) { 42 | const orderID = ordersGroup[i]; 43 | let tempOrder = []; 44 | 45 | for (let j = 0; j < orders.length; j++) { 46 | const order = orders[j]; 47 | 48 | if (orderID.order_id == order.order_id) { 49 | // 获取每个商品详细信息 50 | const product = await productDao.GetProductById(order.product_id); 51 | order.product_name = product[0].product_name; 52 | order.product_picture = product[0].product_picture; 53 | 54 | tempOrder.push(order); 55 | } 56 | } 57 | ordersList.push(tempOrder); 58 | } 59 | 60 | ctx.body = { 61 | code: '001', 62 | orders: ordersList 63 | } 64 | 65 | }, 66 | /** 67 | * 添加用户订单信息 68 | * @param {Object} ctx 69 | */ 70 | AddOrder: async (ctx) => { 71 | let { user_id, products } = ctx.request.body; 72 | // 校验用户是否登录 73 | if (!checkLogin(ctx, user_id)) { 74 | return; 75 | } 76 | 77 | // 获取当前时间戳 78 | const timeTemp = new Date().getTime(); 79 | // 生成订单id:用户id+时间戳(string) 80 | const orderID = +("" + user_id + timeTemp); 81 | 82 | let data = []; 83 | // 根据数据库表结构生成字段信息 84 | for (let i = 0; i < products.length; i++) { 85 | const temp = products[i]; 86 | let product = [orderID, user_id, temp.productID, temp.num, temp.price, timeTemp]; 87 | data.push(...product); 88 | } 89 | 90 | try { 91 | // 把订单信息插入数据库 92 | const result = await orderDao.AddOrder(products.length, data); 93 | 94 | // 插入成功 95 | if (result.affectedRows == products.length) { 96 | //删除购物车 97 | let rows = 0; 98 | for (let i = 0; i < products.length; i++) { 99 | const temp = products[i]; 100 | const res = await shoppingCartDao.DeleteShoppingCart(user_id, temp.productID); 101 | rows += res.affectedRows; 102 | } 103 | //判断删除购物车是否成功 104 | if (rows != products.length) { 105 | ctx.body = { 106 | code: '002', 107 | msg: '购买成功,但购物车没有更新成功' 108 | } 109 | return; 110 | } 111 | 112 | ctx.body = { 113 | code: '001', 114 | msg: '购买成功' 115 | } 116 | } else { 117 | ctx.body = { 118 | code: '004', 119 | msg: '购买失败,未知原因' 120 | } 121 | } 122 | } catch (error) { 123 | reject(error); 124 | } 125 | } 126 | } -------------------------------------------------------------------------------- /app/controllers/productController.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 商品模块控制器 3 | * @Author: hai-27 4 | * @Date: 2020-02-07 16:51:56 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-02-27 15:41:11 7 | */ 8 | const productDao = require('../models/dao/productDao'); 9 | module.exports = { 10 | /** 11 | * 获取商品分类 12 | * @param {Object} ctx 13 | */ 14 | GetCategory: async ctx => { 15 | const category = await productDao.GetCategory(); 16 | 17 | ctx.body = { 18 | code: '001', 19 | category 20 | } 21 | }, 22 | /** 23 | * 根据商品分类名称获取首页展示的商品信息 24 | * @param {Object} ctx 25 | */ 26 | GetPromoProduct: async ctx => { 27 | let { categoryName } = ctx.request.body; 28 | // 根据商品分类名称获取分类id 29 | const categoryID = await productDao.GetCategoryId(categoryName); 30 | // 根据商品分类id获取首页展示的商品信息 31 | const Product = await productDao.GetPromoProduct(categoryID); 32 | 33 | ctx.body = { 34 | code: '001', 35 | Product 36 | } 37 | }, 38 | /** 39 | * 根据商品分类名称获取热门商品信息 40 | * @param {Object} ctx 41 | */ 42 | GetHotProduct: async ctx => { 43 | let { categoryName } = ctx.request.body; 44 | const categoryID = []; 45 | 46 | for (let i = 0; i < categoryName.length; i++) { 47 | // 根据商品分类名称获取分类id 48 | const category_id = await productDao.GetCategoryId(categoryName[i]); 49 | categoryID.push(category_id); 50 | } 51 | // 根据商品分类id获取商品信息 52 | const Product = await productDao.GetProductByCategory(categoryID, 0, 7); 53 | 54 | ctx.body = { 55 | code: '001', 56 | Product 57 | } 58 | }, 59 | /** 60 | * 分页获取所有的商品信息 61 | * @param {Object} ctx 62 | */ 63 | GetAllProduct: async ctx => { 64 | let { currentPage, pageSize } = ctx.request.body; 65 | // 计算开始索引 66 | const offset = (currentPage - 1) * pageSize; 67 | const Product = await productDao.GetAllProduct(offset, pageSize); 68 | // 获取所有的商品数量,用于前端分页计算 69 | const total = (await productDao.GetAllProduct()).length; 70 | ctx.body = { 71 | code: '001', 72 | Product, 73 | total 74 | } 75 | }, 76 | /** 77 | * 根据分类id,分页获取商品信息 78 | * @param {Object} ctx 79 | */ 80 | GetProductByCategory: async ctx => { 81 | let { categoryID, currentPage, pageSize } = ctx.request.body; 82 | // 计算开始索引 83 | const offset = (currentPage - 1) * pageSize; 84 | // 分页获取该分类的商品信息 85 | const Product = await productDao.GetProductByCategory(categoryID, offset, pageSize); 86 | // 获取该分类所有的商品数量,用于前端分页计算 87 | const total = (await productDao.GetProductByCategory(categoryID)).length; 88 | 89 | ctx.body = { 90 | code: '001', 91 | Product, 92 | total 93 | } 94 | }, 95 | /** 96 | * 根据搜索条件,分页获取商品信息 97 | * @param {Object} ctx 98 | */ 99 | GetProductBySearch: async ctx => { 100 | let { search, currentPage, pageSize } = ctx.request.body; 101 | // 计算开始索引 102 | const offset = (currentPage - 1) * pageSize; 103 | // 获取分类列表 104 | const category = await productDao.GetCategory(); 105 | 106 | let Product; 107 | let total; 108 | 109 | for (let i = 0; i < category.length; i++) { 110 | // 如果搜索条件为某个分类名称,直接返回该分类的商品信息 111 | if (search == category[i].category_name) { 112 | // 获取该分类的商品信息 113 | Product = await productDao.GetProductByCategory(category[i].category_id, offset, pageSize); 114 | // 获取该分类所有的商品数量,用于前端分页计算 115 | total = (await productDao.GetProductByCategory(category[i].category_id)).length; 116 | 117 | ctx.body = { 118 | code: '001', 119 | Product, 120 | total 121 | } 122 | return; 123 | } 124 | } 125 | // 否则返回根据查询条件模糊查询的商品分页结果 126 | Product = await productDao.GetProductBySearch(search, offset, pageSize); 127 | // 获取模糊查询的商品结果总数 128 | total = (await productDao.GetProductBySearch(search)).length; 129 | 130 | ctx.body = { 131 | code: '001', 132 | Product, 133 | total 134 | } 135 | }, 136 | /** 137 | * 根据商品id,获取商品详细信息 138 | * @param {Object} ctx 139 | */ 140 | GetDetails: async ctx => { 141 | let { productID } = ctx.request.body; 142 | 143 | const Product = await productDao.GetProductById(productID); 144 | 145 | ctx.body = { 146 | code: '001', 147 | Product, 148 | } 149 | }, 150 | /** 151 | * 根据商品id,获取商品图片,用于食品详情的页面展示 152 | * @param {Object} ctx 153 | */ 154 | GetDetailsPicture: async ctx => { 155 | let { productID } = ctx.request.body; 156 | 157 | const ProductPicture = await productDao.GetDetailsPicture(productID); 158 | 159 | ctx.body = { 160 | code: '001', 161 | ProductPicture, 162 | } 163 | } 164 | } -------------------------------------------------------------------------------- /app/controllers/resourcesController.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 资源模块控制器 3 | * @Author: hai-27 4 | * @Date: 2020-02-07 16:51:56 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-02-27 14:33:10 7 | */ 8 | const resourcesDao = require('../models/dao/resourcesDao'); 9 | module.exports = { 10 | /** 11 | * 获取轮播图数据 12 | * @param {Object} ctx 13 | */ 14 | Carousel: async ctx => { 15 | let carousel = await resourcesDao.Carousel(); 16 | ctx.body = { 17 | code: '001', 18 | carousel 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /app/controllers/shoppingCartController.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 购物车模块控制器 3 | * @Author: hai-27 4 | * @Date: 2020-02-19 16:15:14 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-02-27 15:58:46 7 | */ 8 | const shoppingCartDao = require('../models/dao/shoppingCartDao'); 9 | const productDao = require('../models/dao/productDao'); 10 | const checkLogin = require('../middleware/checkLogin'); 11 | 12 | let methods = { 13 | /** 14 | * 生成购物车详细信息 15 | * @param {Object} data 16 | */ 17 | ShoppingCartData: async data => { 18 | let shoppingCartData = []; 19 | for (let i = 0; i < data.length; i++) { 20 | const temp = data[i]; 21 | const product = await productDao.GetProductById(temp.product_id); 22 | 23 | let shoppingCartDataTemp = { 24 | id: temp.id, 25 | productID: temp.product_id, 26 | productName: product[0].product_name, 27 | productImg: product[0].product_picture, 28 | price: product[0].product_selling_price, 29 | num: temp.num, 30 | maxNum: Math.floor(product[0].product_num / 2), 31 | check: false 32 | }; 33 | 34 | shoppingCartData.push(shoppingCartDataTemp); 35 | } 36 | return shoppingCartData; 37 | } 38 | } 39 | 40 | module.exports = { 41 | /** 42 | * 获取购物车信息 43 | * @param {Object} ctx 44 | */ 45 | GetShoppingCart: async ctx => { 46 | let { user_id } = ctx.request.body; 47 | // 校验用户是否登录 48 | if (!checkLogin(ctx, user_id)) { 49 | return; 50 | } 51 | // 获取购物车信息 52 | const shoppingCart = await shoppingCartDao.GetShoppingCart(user_id); 53 | // 生成购物车详细信息 54 | const data = await methods.ShoppingCartData(shoppingCart); 55 | 56 | ctx.body = { 57 | code: '001', 58 | shoppingCartData: data 59 | } 60 | }, 61 | /** 62 | * 插入购物车信息 63 | * @param {Object} ctx 64 | */ 65 | AddShoppingCart: async ctx => { 66 | let { user_id, product_id } = ctx.request.body; 67 | // 校验用户是否登录 68 | if (!checkLogin(ctx, user_id)) { 69 | return; 70 | } 71 | 72 | let tempShoppingCart = await shoppingCartDao.FindShoppingCart(user_id, product_id); 73 | //判断该用户的购物车是否存在该商品 74 | if (tempShoppingCart.length > 0) { 75 | //如果存在则把数量+1 76 | const tempNum = tempShoppingCart[0].num + 1; 77 | 78 | const product = await productDao.GetProductById(tempShoppingCart[0].product_id); 79 | const maxNum = Math.floor(product[0].product_num / 2); 80 | //判断数量是否达到限购数量 81 | if (tempNum > maxNum) { 82 | ctx.body = { 83 | code: '003', 84 | msg: '数量达到限购数量 ' + maxNum 85 | } 86 | return; 87 | } 88 | 89 | try { 90 | // 更新购物车信息,把数量+1 91 | const result = await shoppingCartDao.UpdateShoppingCart(tempNum, user_id, product_id); 92 | 93 | if (result.affectedRows === 1) { 94 | ctx.body = { 95 | code: '002', 96 | msg: '该商品已在购物车,数量 +1' 97 | } 98 | return; 99 | } 100 | } catch (error) { 101 | reject(error); 102 | } 103 | } else { 104 | //不存在则添加 105 | try { 106 | // 新插入购物车信息 107 | const res = await shoppingCartDao.AddShoppingCart(user_id, product_id); 108 | // 判断是否插入成功 109 | if (res.affectedRows === 1) { 110 | // 如果成功,获取该商品的购物车信息 111 | const shoppingCart = await shoppingCartDao.FindShoppingCart(user_id, product_id); 112 | // 生成购物车详细信息 113 | const data = await methods.ShoppingCartData(shoppingCart); 114 | 115 | ctx.body = { 116 | code: '001', 117 | msg: '添加购物车成功', 118 | shoppingCartData: data 119 | } 120 | return; 121 | } 122 | } catch (error) { 123 | reject(error); 124 | } 125 | } 126 | 127 | ctx.body = { 128 | code: '005', 129 | msg: '添加购物车失败,未知错误' 130 | } 131 | }, 132 | /** 133 | * 删除购物车信息 134 | * @param {Object} ctx 135 | */ 136 | DeleteShoppingCart: async ctx => { 137 | let { user_id, product_id } = ctx.request.body; 138 | // 校验用户是否登录 139 | if (!checkLogin(ctx, user_id)) { 140 | return; 141 | } 142 | 143 | // 判断该用户的购物车是否存在该商品 144 | let tempShoppingCart = await shoppingCartDao.FindShoppingCart(user_id, product_id); 145 | 146 | if (tempShoppingCart.length > 0) { 147 | // 如果存在则删除 148 | try { 149 | const result = await shoppingCartDao.DeleteShoppingCart(user_id, product_id); 150 | // 判断是否删除成功 151 | if (result.affectedRows === 1) { 152 | ctx.body = { 153 | code: '001', 154 | msg: '删除购物车成功' 155 | } 156 | return; 157 | } 158 | } catch (error) { 159 | reject(error); 160 | } 161 | } else { 162 | // 不存在则返回信息 163 | ctx.body = { 164 | code: '002', 165 | msg: '该商品不在购物车' 166 | } 167 | } 168 | }, 169 | /** 170 | * 更新购物车商品数量 171 | * @param {Object} ctx 172 | */ 173 | UpdateShoppingCart: async ctx => { 174 | let { user_id, product_id, num } = ctx.request.body; 175 | // 校验用户是否登录 176 | if (!checkLogin(ctx, user_id)) { 177 | return; 178 | } 179 | // 判断数量是否小于1 180 | if (num < 1) { 181 | ctx.body = { 182 | code: '004', 183 | msg: '数量不合法' 184 | } 185 | return; 186 | } 187 | // 判断该用户的购物车是否存在该商品 188 | let tempShoppingCart = await shoppingCartDao.FindShoppingCart(user_id, product_id); 189 | 190 | if (tempShoppingCart.length > 0) { 191 | // 如果存在则修改 192 | 193 | // 判断数量是否有变化 194 | if (tempShoppingCart[0].num == num) { 195 | ctx.body = { 196 | code: '003', 197 | msg: '数量没有发生变化' 198 | } 199 | return; 200 | } 201 | const product = await productDao.GetProductById(product_id); 202 | const maxNum = Math.floor(product[0].product_num / 2); 203 | // 判断数量是否达到限购数量 204 | if (num > maxNum) { 205 | ctx.body = { 206 | code: '004', 207 | msg: '数量达到限购数量 ' + maxNum 208 | } 209 | return; 210 | } 211 | 212 | try { 213 | // 修改购物车信息 214 | const result = await shoppingCartDao.UpdateShoppingCart(num, user_id, product_id); 215 | // 判断是否修改成功 216 | if (result.affectedRows === 1) { 217 | ctx.body = { 218 | code: '001', 219 | msg: '修改购物车数量成功' 220 | } 221 | return; 222 | } 223 | } catch (error) { 224 | reject(error); 225 | } 226 | } else { 227 | //不存在则返回信息 228 | ctx.body = { 229 | code: '002', 230 | msg: '该商品不在购物车' 231 | } 232 | } 233 | } 234 | } -------------------------------------------------------------------------------- /app/controllers/userController.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 用户模块控制器 3 | * @Author: hai-27 4 | * @Date: 2020-02-07 16:51:56 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-03-27 16:03:09 7 | */ 8 | const rp = require('request-promise'); 9 | const userDao = require('../models/dao/userDao'); 10 | const { checkUserInfo, checkUserName } = require('../middleware/checkUserInfo'); 11 | 12 | module.exports = { 13 | 14 | /** 15 | * 用户登录 16 | * @param {Object} ctx 17 | */ 18 | Login: async ctx => { 19 | 20 | let { userName, password } = ctx.request.body; 21 | 22 | // 校验用户信息是否符合规则 23 | if (!checkUserInfo(ctx, userName, password)) { 24 | return; 25 | } 26 | 27 | // 连接数据库根据用户名和密码查询用户信息 28 | let user = await userDao.Login(userName, password); 29 | // 结果集长度为0则代表没有该用户 30 | if (user.length === 0) { 31 | ctx.body = { 32 | code: '004', 33 | msg: '用户名或密码错误' 34 | } 35 | return; 36 | } 37 | 38 | // 数据库设置用户名唯一 39 | // 结果集长度为1则代表存在该用户 40 | if (user.length === 1) { 41 | 42 | const loginUser = { 43 | user_id: user[0].user_id, 44 | userName: user[0].userName 45 | }; 46 | // 保存用户信息到session 47 | ctx.session.user = loginUser; 48 | 49 | ctx.body = { 50 | code: '001', 51 | user: loginUser, 52 | msg: '登录成功' 53 | } 54 | return; 55 | } 56 | 57 | //数据库设置用户名唯一 58 | //若存在user.length != 1 || user.length!=0 59 | //返回未知错误 60 | //正常不会出现 61 | ctx.body = { 62 | code: '500', 63 | msg: '未知错误' 64 | } 65 | }, 66 | /** 67 | * 微信小程序用户登录 68 | * @param {Object} ctx 69 | */ 70 | miniProgramLogin: async ctx => { 71 | const appid = 'wxeb6a44c58ffde6c6'; 72 | const secret = '9c40f33cf627f2e3a42f38b25e0687cc'; 73 | let { code } = ctx.request.body; 74 | 75 | const api = `https://api.weixin.qq.com/sns/jscode2session?appid=${ appid }&secret=${ secret }&js_code=${ code }&grant_type=authorization_code`; 76 | // 通过 wx.login 接口获得临时登录凭证 code 后 77 | // 传到开发者服务器调用此接口完成登录流程。 78 | const res = await rp.get({ 79 | json: true, 80 | uri: api 81 | }) 82 | const { session_key, openid } = res; 83 | 84 | // 连接数据库根据用户名查询用户信息 85 | let user = await userDao.FindUserName(openid); 86 | if (user.length === 0) { 87 | // 结果集长度为0则代表不存在该用户,先注册 88 | try { 89 | // 连接数据库插入用户信息 90 | let registerResult = await userDao.Register(openid, openid); 91 | if (registerResult.affectedRows === 1) { 92 | // 操作所影响的记录行数为1,则代表注册成功 93 | await login();// 登录 94 | } 95 | } catch (error) { 96 | console.log(error) 97 | } 98 | } else if (user.length === 1) { 99 | // 如果已经存在,直接登录 100 | await login(); 101 | } else { 102 | ctx.body = { 103 | code: '500', 104 | msg: '未知错误' 105 | } 106 | } 107 | async function login () { 108 | // 连接数据库根据用户名和密码查询用户信息 109 | let tempUser = await userDao.Login(openid, openid); 110 | if (tempUser.length === 0) { 111 | // 登录失败 112 | ctx.body = { 113 | code: '004', 114 | msg: '登录失败' 115 | } 116 | return; 117 | } 118 | if (tempUser.length === 1) { 119 | // 登录成功 120 | const loginUser = { 121 | user_id: tempUser[0].user_id, 122 | openId: openid, 123 | sessionKey: session_key 124 | }; 125 | // 保存用户信息到session 126 | ctx.session.user = loginUser; 127 | 128 | ctx.body = { 129 | code: '001', 130 | userId: tempUser[0].user_id, 131 | msg: '登录成功' 132 | } 133 | return; 134 | } 135 | } 136 | }, 137 | /** 138 | * 查询是否存在某个用户名,用于注册时前端校验 139 | * @param {Object} ctx 140 | */ 141 | FindUserName: async ctx => { 142 | let { userName } = ctx.request.body; 143 | 144 | // 校验用户名是否符合规则 145 | if (!checkUserName(ctx, userName)) { 146 | return; 147 | } 148 | // 连接数据库根据用户名查询用户信息 149 | let user = await userDao.FindUserName(userName); 150 | // 结果集长度为0则代表不存在该用户,可以注册 151 | if (user.length === 0) { 152 | ctx.body = { 153 | code: '001', 154 | msg: '用户名不存在,可以注册' 155 | } 156 | return; 157 | } 158 | 159 | //数据库设置用户名唯一 160 | //结果集长度为1则代表存在该用户,不可以注册 161 | if (user.length === 1) { 162 | ctx.body = { 163 | code: '004', 164 | msg: '用户名已经存在,不能注册' 165 | } 166 | return; 167 | } 168 | 169 | //数据库设置用户名唯一, 170 | //若存在user.length != 1 || user.length!=0 171 | //返回未知错误 172 | //正常不会出现 173 | ctx.body = { 174 | code: '500', 175 | msg: '未知错误' 176 | } 177 | }, 178 | Register: async ctx => { 179 | let { userName, password } = ctx.request.body; 180 | 181 | // 校验用户信息是否符合规则 182 | if (!checkUserInfo(ctx, userName, password)) { 183 | return; 184 | } 185 | // 连接数据库根据用户名查询用户信息 186 | // 先判断该用户是否存在 187 | let user = await userDao.FindUserName(userName); 188 | 189 | if (user.length !== 0) { 190 | ctx.body = { 191 | code: '004', 192 | msg: '用户名已经存在,不能注册' 193 | } 194 | return; 195 | } 196 | 197 | try { 198 | // 连接数据库插入用户信息 199 | let registerResult = await userDao.Register(userName, password); 200 | // 操作所影响的记录行数为1,则代表注册成功 201 | if (registerResult.affectedRows === 1) { 202 | ctx.body = { 203 | code: '001', 204 | msg: '注册成功' 205 | } 206 | return; 207 | } 208 | // 否则失败 209 | ctx.body = { 210 | code: '500', 211 | msg: '未知错误,注册失败' 212 | } 213 | } catch (error) { 214 | reject(error); 215 | } 216 | } 217 | }; -------------------------------------------------------------------------------- /app/middleware/RewriteUrl.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 重写静态资源URL 3 | * @Author: hai-27 4 | * @Date: 2020-04-07 23:24:37 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-04-07 23:26:37 7 | */ 8 | module.exports = async (ctx, next) => { 9 | if (ctx.url.startsWith('/public')) { 10 | ctx.url = ctx.url.replace('/public', ''); 11 | } 12 | await next(); 13 | } -------------------------------------------------------------------------------- /app/middleware/checkLogin.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 判断是否登录(session中的用户id与请求体传过来的用户id是否一致) 3 | * @Author: hai-27 4 | * @Date: 2020-02-25 15:35:58 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-02-27 01:59:46 7 | */ 8 | 9 | /** 10 | * 校验用户是否登录 11 | * @param {Object} ctx 12 | * @param {int} user_id 13 | * @returns 14 | */ 15 | module.exports = function (ctx, user_id) { 16 | // 判断请求传递的用户id 与 session中的用户id是否一致 17 | if (user_id != ctx.session.user.user_id) { 18 | ctx.body = { 19 | code: '401', 20 | msg: '用户名没有登录,请登录后再操作' 21 | } 22 | return false; 23 | } 24 | return true; 25 | } -------------------------------------------------------------------------------- /app/middleware/checkUserInfo.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 校验用户信息是否符合规则 3 | * @Author: hai-27 4 | * @Date: 2020-02-25 15:43:27 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-02-27 02:04:35 7 | */ 8 | module.exports = { 9 | /** 10 | * 校验用户信息是否符合规则 11 | * @param {Object} ctx 12 | * @param {string} userName 13 | * @param {string} password 14 | * @return: 15 | */ 16 | checkUserInfo: (ctx, userName = '', password = '') => { 17 | // userName = userName ? userName : ''; 18 | // password = password ? password : ''; 19 | // 判断是否为空 20 | if (userName.length === 0 || password.length === 0) { 21 | ctx.body = { 22 | code: '002', 23 | msg: '用户名或密码不能为空' 24 | } 25 | return false; 26 | } 27 | // 用户名校验规则 28 | const userNameRule = /^[a-zA-Z][a-zA-Z0-9_]{4,15}$/; 29 | if (!userNameRule.test(userName)) { 30 | ctx.body = { 31 | code: '003', 32 | msg: '用户名不合法(以字母开头,允许5-16字节,允许字母数字下划线)' 33 | } 34 | return false; 35 | } 36 | // 密码校验规则 37 | const passwordRule = /^[a-zA-Z]\w{5,17}$/; 38 | if (!passwordRule.test(password)) { 39 | ctx.body = { 40 | code: '003', 41 | msg: '密码不合法(以字母开头,长度在6~18之间,只能包含字母、数字和下划线)' 42 | } 43 | return false; 44 | } 45 | 46 | return true; 47 | }, 48 | /** 49 | * 校验用户名是否符合规则 50 | * @param {type} 51 | * @return: 52 | */ 53 | checkUserName: (ctx, userName = '') => { 54 | // 判断是否为空 55 | if (userName.length === 0) { 56 | ctx.body = { 57 | code: '002', 58 | msg: '用户名不能为空' 59 | } 60 | return false; 61 | } 62 | // 用户名校验规则 63 | const userNameRule = /^[a-zA-Z][a-zA-Z0-9_]{4,15}$/; 64 | if (!userNameRule.test(userName)) { 65 | ctx.body = { 66 | code: '003', 67 | msg: '用户名不合法(以字母开头,允许5-16字节,允许字母数字下划线)' 68 | } 69 | return false; 70 | } 71 | 72 | return true; 73 | } 74 | } -------------------------------------------------------------------------------- /app/middleware/error.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 全局错误处理中间件 3 | * @Author: hai-27 4 | * @Date: 2020-04-07 23:11:48 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-04-07 23:13:33 7 | */ 8 | module.exports = async (ctx, next) => { 9 | try { 10 | await next(); 11 | } catch (error) { 12 | console.log(error); 13 | ctx.body = { 14 | code: '500', 15 | msg: '服务器未知错误' 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /app/middleware/isLogin.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 全局登录拦截器 3 | * @Author: hai-27 4 | * @Date: 2020-04-07 22:42:36 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-04-07 22:44:52 7 | */ 8 | module.exports = async (ctx, next) => { 9 | if (ctx.url.startsWith('/user/')) { 10 | if (!ctx.session.user) { 11 | ctx.body = { 12 | code: '401', 13 | msg: '用户没有登录,请登录后再操作' 14 | } 15 | return; 16 | } 17 | } 18 | await next(); 19 | } -------------------------------------------------------------------------------- /app/middleware/koaBodyConfig.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: koaBody 配置 3 | * @Author: hai-27 4 | * @Date: 2020-04-07 23:18:29 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-04-07 23:21:35 7 | */ 8 | let { uploadDir } = require('../../config'); 9 | 10 | const koaBodyConfig = { 11 | multipart: true, 12 | // parsedMethods默认是['POST', 'PUT', 'PATCH'] 13 | parsedMethods: ['POST', 'PUT', 'PATCH', 'GET', 'HEAD', 'DELETE'], 14 | formidable: { 15 | uploadDir: uploadDir, // 设置文件上传目录 16 | keepExtensions: true, // 保持文件的后缀 17 | maxFieldsSize: 2 * 1024 * 1024, // 文件上传大小限制 18 | onFileBegin: (name, file) => { // 文件上传前的设置 19 | // console.log(`name: ${name}`); 20 | // console.log(file); 21 | } 22 | } 23 | } 24 | 25 | module.exports = koaBodyConfig; -------------------------------------------------------------------------------- /app/middleware/session.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: session配置 3 | * @Author: hai-27 4 | * @Date: 2020-04-07 22:28:43 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-04-07 22:29:28 7 | */ 8 | let store = { 9 | storage: {}, 10 | set (key, session) { 11 | this.storage[key] = session; 12 | }, 13 | get (key) { 14 | return this.storage[key]; 15 | }, 16 | destroy (key) { 17 | delete this.storage[key]; 18 | } 19 | } 20 | let CONFIG = { 21 | key: 'koa:session', 22 | maxAge: 86400000, 23 | autoCommit: true, 24 | overwrite: true, 25 | httpOnly: true, 26 | signed: true, 27 | rolling: false, 28 | renew: false, 29 | sameSite: null, 30 | store 31 | } 32 | 33 | module.exports = CONFIG; -------------------------------------------------------------------------------- /app/models/dao/collectDao.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 我的收藏模块数据持久层 3 | * @Author: hai-27 4 | * @Date: 2020-03-04 22:33:56 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-03-10 17:50:37 7 | */ 8 | const db = require('./db.js'); 9 | 10 | module.exports = { 11 | // 连接数据库,把收藏商品信息插入数据库 12 | AddCollect: async (user_id, product_id, timeTemp) => { 13 | const sql = 'insert into collect values(null,?,?,?)'; 14 | return await db.query(sql, [user_id, product_id, timeTemp]); 15 | }, 16 | // 连接数据库,获取用户的所有收藏商品信息 17 | GetCollect: async (user_id) => { 18 | const sql = 'select * from collect where user_id=?'; 19 | return await db.query(sql, user_id); 20 | }, 21 | // 连接数据库,获取用户的某个收藏商品信息 22 | FindCollect: async (user_id, product_id) => { 23 | const sql = 'select * from collect where user_id=? and product_id=?'; 24 | return await db.query(sql, [user_id, product_id]); 25 | }, 26 | // 连接数据库,删除用户的某个收藏商品信息 27 | DeleteCollect: async (user_id, product_id) => { 28 | const sql = 'delete from collect where user_id=? and product_id=?'; 29 | return await db.query(sql, [user_id, product_id]); 30 | } 31 | } -------------------------------------------------------------------------------- /app/models/dao/db.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 数据库连接 3 | * @Author: hai-27 4 | * @Date: 2020-02-07 16:51:56 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-02-27 13:20:11 7 | */ 8 | var mysql = require('mysql'); 9 | const { dbConfig } = require('../../../config'); 10 | var pool = mysql.createPool(dbConfig); 11 | 12 | var db = {}; 13 | 14 | db.query = function (sql, params) { 15 | 16 | return new Promise((resolve, reject) => { 17 | // 取出链接 18 | pool.getConnection(function (err, connection) { 19 | 20 | if (err) { 21 | reject(err); 22 | return; 23 | } 24 | 25 | connection.query(sql, params, function (error, results, fields) { 26 | console.log(`${ sql }=>${ params }`); 27 | // 释放连接 28 | connection.release(); 29 | if (error) { 30 | reject(error); 31 | return; 32 | } 33 | resolve(results); 34 | }); 35 | 36 | }); 37 | }); 38 | } 39 | // 导出对象 40 | module.exports = db; 41 | -------------------------------------------------------------------------------- /app/models/dao/orderDao.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 订单模块数据持久层 3 | * @Author: hai-27 4 | * @Date: 2020-02-24 16:36:19 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-02-27 14:31:56 7 | */ 8 | const db = require('./db.js'); 9 | 10 | module.exports = { 11 | // 连接数据库获取所有的订单id 12 | GetOrderGroup: async (user_id) => { 13 | let sql = 'select order_id from orders where user_id = ? group by order_id desc'; 14 | return await db.query(sql, user_id); 15 | }, 16 | // 连接数据库获取所有的订单详细信息 17 | GetOrder: async (user_id) => { 18 | let sql = 'select * from orders where user_id =? order by order_time desc'; 19 | return await db.query(sql, user_id); 20 | }, 21 | // 连接数据库插入订单信息 22 | AddOrder: async (length, data) => { 23 | let sql = 'insert into orders values(null,?,?,?,?,?,?)'; 24 | for (let i = 0; i < length - 1; i++) { 25 | sql += ",(null,?,?,?,?,?,?)" 26 | } 27 | 28 | return await db.query(sql, data); 29 | } 30 | } -------------------------------------------------------------------------------- /app/models/dao/productDao.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 商品模块数据持久层 3 | * @Author: hai-27 4 | * @Date: 2020-02-07 16:51:56 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-02-27 15:42:52 7 | */ 8 | const db = require('./db.js'); 9 | 10 | module.exports = { 11 | // 连接数据库获取商品分类 12 | GetCategory: async () => { 13 | const sql = "select * from category"; 14 | return await db.query(sql, []); 15 | }, 16 | // 连接数据库根据商品分类名称获取分类id 17 | GetCategoryId: async (categoryName) => { 18 | const sql = "select * from category where category_name = ?"; 19 | const category = await db.query(sql, [categoryName]); 20 | return category[0].category_id; 21 | }, 22 | // 连接数据库,根据商品分类id获取首页展示的商品信息 23 | GetPromoProduct: async (categoryID) => { 24 | const sql = "select * from product where category_id = ? order by product_sales desc limit 7"; 25 | return await db.query(sql, categoryID); 26 | }, 27 | // 连接数据库,分页获取所有的商品信息 28 | GetAllProduct: async (offset = 0, rows = 0) => { 29 | let sql = "select * from product "; 30 | if (rows != 0) { 31 | sql += "limit " + offset + "," + rows; 32 | } 33 | return await db.query(sql, []); 34 | }, 35 | // 连接数据库,根据商品分类id,分页获取商品信息 36 | GetProductByCategory: async (categoryID, offset = 0, rows = 0) => { 37 | let sql = "select * from product where category_id = ? "; 38 | 39 | for (let i = 0; i < categoryID.length - 1; i++) { 40 | sql += "or category_id = ? "; 41 | } 42 | if (rows != 0) { 43 | sql += "order by product_sales desc limit " + offset + "," + rows; 44 | } 45 | 46 | return await db.query(sql, categoryID); 47 | }, 48 | // 连接数据库,根据搜索条件,分页获取商品信息 49 | GetProductBySearch: async (search, offset = 0, rows = 0) => { 50 | let sql = `select * from product where product_name like "%${ search }%" or product_title like "%${ search }%" or product_intro like "%${ search }%"`; 51 | 52 | if (rows != 0) { 53 | sql += "order by product_sales desc limit " + offset + "," + rows; 54 | } 55 | 56 | return await db.query(sql, []); 57 | }, 58 | // 连接数据库,根据商品id,获取商品详细信息 59 | GetProductById: async (id) => { 60 | const sql = 'select * from product where product_id = ?'; 61 | return await db.query(sql, id); 62 | }, 63 | // 连接数据库,根据商品id,获取商品图片 64 | GetDetailsPicture: async (productID) => { 65 | const sql = "select * from product_picture where product_id = ? "; 66 | return await db.query(sql, productID); 67 | } 68 | } -------------------------------------------------------------------------------- /app/models/dao/resourcesDao.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 资源模块数据持久层 3 | * @Author: hai-27 4 | * @Date: 2020-02-07 16:51:56 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-02-27 14:33:43 7 | */ 8 | const db = require('./db.js'); 9 | 10 | module.exports = { 11 | // 连接数据库获取轮播图数据 12 | Carousel: async () => { 13 | const sql = 'select * from carousel'; 14 | return await db.query(sql, []); 15 | } 16 | } -------------------------------------------------------------------------------- /app/models/dao/shoppingCartDao.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 购物车模块数据持久层 3 | * @Author: hai-27 4 | * @Date: 2020-02-19 16:17:19 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-02-27 15:58:55 7 | */ 8 | const db = require('./db.js'); 9 | 10 | module.exports = { 11 | // 获取购物车信息 12 | GetShoppingCart: async (user_id) => { 13 | const sql = 'select * from shoppingCart where user_id = ?'; 14 | return await db.query(sql, user_id); 15 | }, 16 | // 查询用户的购物车的某个商品 17 | FindShoppingCart: async (user_id, product_id) => { 18 | const sql = 'select * from shoppingCart where user_id = ? and product_id = ?'; 19 | return await db.query(sql, [user_id, product_id]); 20 | }, 21 | // 新插入购物车信息 22 | AddShoppingCart: async (user_id, product_id) => { 23 | const sql = 'insert into shoppingCart values(null,?,?,1)'; 24 | return await db.query(sql, [user_id, product_id]); 25 | }, 26 | // 更新购物车商品数量 27 | UpdateShoppingCart: async (NewNum, user_id, product_id) => { 28 | const sql = 'update shoppingCart set num =? where user_id =? and product_id =?'; 29 | return await db.query(sql, [NewNum, user_id, product_id]); 30 | }, 31 | // 删除购物车信息 32 | DeleteShoppingCart: async (user_id, product_id) => { 33 | const sql = 'delete from shoppingCart where user_id =? and product_id =?'; 34 | return await db.query(sql, [user_id, product_id]); 35 | } 36 | } -------------------------------------------------------------------------------- /app/models/dao/userDao.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 用户模块数据持久层 3 | * @Author: hai-27 4 | * @Date: 2020-02-07 16:51:56 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-02-27 02:12:30 7 | */ 8 | const db = require('./db.js'); 9 | 10 | module.exports = { 11 | // 连接数据库根据用户名和密码查询用户信息 12 | Login: async (userName, password) => { 13 | const sql = 'select * from users where userName = ? and password = ?'; 14 | return await db.query(sql, [userName, password]); 15 | }, 16 | // 连接数据库根据用户名查询用户信息 17 | FindUserName: async (userName) => { 18 | const sql = 'select * from users where userName = ?'; 19 | return await db.query(sql, [userName]); 20 | }, 21 | // 连接数据库插入用户信息 22 | Register: async (userName, password) => { 23 | const sql = 'insert into users values(null,?,?,null)'; 24 | return await db.query(sql, [userName, password]); 25 | } 26 | } -------------------------------------------------------------------------------- /app/routers/index.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 汇总模块子路由 3 | * @Author: hai-27 4 | * @Date: 2020-04-07 22:51:48 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-04-07 22:57:35 7 | */ 8 | const Router = require('koa-router'); 9 | 10 | let Routers = new Router(); 11 | 12 | const userRouter = require('./router/userRouter'); 13 | const resourcesRouter = require('./router/resourcesRouter'); 14 | const productRouter = require('./router/productRouter'); 15 | const shoppingCartRouter = require('./router/shoppingCartRouter'); 16 | const orderRouter = require('./router/orderRouter'); 17 | const collectRouter = require('./router/collectRouter'); 18 | 19 | Routers.use(userRouter.routes()); 20 | Routers.use(resourcesRouter.routes()); 21 | Routers.use(productRouter.routes()); 22 | Routers.use(shoppingCartRouter.routes()); 23 | Routers.use(orderRouter.routes()); 24 | Routers.use(collectRouter.routes()); 25 | 26 | module.exports = Routers; -------------------------------------------------------------------------------- /app/routers/router/collectRouter.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 我的收藏模块路由 3 | * @Author: hai-27 4 | * @Date: 2020-03-04 22:28:01 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-04-07 22:52:36 7 | */ 8 | const Router = require('koa-router'); 9 | const collectController = require('../../controllers/collectController') 10 | 11 | let collectRouter = new Router(); 12 | 13 | collectRouter 14 | .post('/user/collect/addCollect', collectController.AddCollect) 15 | .post('/user/collect/getCollect', collectController.GetCollect) 16 | .post('/user/collect/deleteCollect', collectController.DeleteCollect) 17 | 18 | module.exports = collectRouter; -------------------------------------------------------------------------------- /app/routers/router/orderRouter.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 订单模块路由 3 | * @Author: hai-27 4 | * @Date: 2020-02-24 16:29:26 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-04-07 22:52:48 7 | */ 8 | const Router = require('koa-router'); 9 | const orderController = require('../../controllers/orderController') 10 | 11 | let orderRouter = new Router(); 12 | 13 | orderRouter 14 | .post('/user/order/getOrder', orderController.GetOrder) 15 | .post('/user/order/addOrder', orderController.AddOrder) 16 | 17 | module.exports = orderRouter; -------------------------------------------------------------------------------- /app/routers/router/productRouter.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 商品模块路由 3 | * @Author: hai-27 4 | * @Date: 2020-02-07 16:51:56 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-04-07 22:52:56 7 | */ 8 | const Router = require('koa-router'); 9 | const productController = require('../../controllers/productController') 10 | 11 | let productRouter = new Router(); 12 | 13 | productRouter 14 | .post('/product/getAllProduct', productController.GetAllProduct) 15 | .post('/product/getPromoProduct', productController.GetPromoProduct) 16 | .post('/product/getHotProduct', productController.GetHotProduct) 17 | .post('/product/getProductByCategory', productController.GetProductByCategory) 18 | .post('/product/getCategory', productController.GetCategory) 19 | .post('/product/getProductBySearch', productController.GetProductBySearch) 20 | .post('/product/getDetails', productController.GetDetails) 21 | .post('/product/getDetailsPicture', productController.GetDetailsPicture) 22 | 23 | module.exports = productRouter; -------------------------------------------------------------------------------- /app/routers/router/resourcesRouter.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 资源模块路由 3 | * @Author: hai-27 4 | * @Date: 2020-02-07 16:51:56 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-02-25 22:36:30 7 | */ 8 | const Router = require('koa-router'); 9 | const resourcesController = require('../../controllers/resourcesController') 10 | 11 | let resourcesRouter = new Router(); 12 | 13 | resourcesRouter 14 | .post('/resources/carousel', resourcesController.Carousel) 15 | 16 | module.exports = resourcesRouter; -------------------------------------------------------------------------------- /app/routers/router/shoppingCartRouter.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 购物车模块路由 3 | * @Author: hai-27 4 | * @Date: 2020-02-19 16:11:18 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-04-07 22:53:07 7 | */ 8 | const Router = require('koa-router'); 9 | const shoppingCartController = require('../../controllers/shoppingCartController') 10 | 11 | let shoppingCartRouter = new Router(); 12 | 13 | shoppingCartRouter 14 | .post('/user/shoppingCart/getShoppingCart', shoppingCartController.GetShoppingCart) 15 | .post('/user/shoppingCart/addShoppingCart', shoppingCartController.AddShoppingCart) 16 | .post('/user/shoppingCart/deleteShoppingCart', shoppingCartController.DeleteShoppingCart) 17 | .post('/user/shoppingCart/updateShoppingCart', shoppingCartController.UpdateShoppingCart) 18 | 19 | module.exports = shoppingCartRouter; -------------------------------------------------------------------------------- /app/routers/router/userRouter.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 用户模块路由 3 | * @Author: hai-27 4 | * @Date: 2020-02-07 16:51:56 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-03-27 12:41:14 7 | */ 8 | const Router = require('koa-router'); 9 | const userController = require('../../controllers/userController') 10 | 11 | let userRouter = new Router(); 12 | 13 | userRouter 14 | .post('/users/login', userController.Login) 15 | .post('/users/miniProgramLogin', userController.miniProgramLogin) 16 | .post('/users/findUserName', userController.FindUserName) 17 | .post('/users/register', userController.Register) 18 | 19 | module.exports = userRouter; -------------------------------------------------------------------------------- /config.js: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 全局配置信息 3 | * @Author: hai-27 4 | * @Date: 2020-02-07 16:51:56 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-02-28 23:21:30 7 | */ 8 | const path = require('path'); 9 | 10 | module.exports = { 11 | Port: 3000, // 启动端口 12 | staticDir: path.resolve('./public'), // 静态资源路径 13 | uploadDir: path.join(__dirname, path.resolve('public/')), // 上传文件路径 14 | // 数据库连接设置 15 | dbConfig: { 16 | connectionLimit: 10, 17 | host: 'localhost', 18 | user: 'root', 19 | password: '', 20 | database: 'storeDB' 21 | } 22 | } -------------------------------------------------------------------------------- /docs/API.md: -------------------------------------------------------------------------------- 1 | # 接口文档 2 | 3 | ## 用户模块 4 | 5 | ### 1. 登录 6 | 7 | **请求URL:** 8 | 9 | ``` 10 | /users/login 11 | ``` 12 | 13 | **请求方式:** 14 | 15 | ``` 16 | Post 17 | ``` 18 | 19 | **参数说明:** 20 | 21 | | 参数 | 是否必选 | 类型 | 说明 | 22 | | :-: | :-: | :-: | :-: | 23 | | userName | 是 | string | 用户名 | 24 | | password | 是 | string | 密码 | 25 | 26 | **返回示例:** 27 | 28 | ```javascript 29 | { 30 | "code": "001", 31 | "user": { 32 | "user_id": 1, 33 | "userName": "admin" 34 | }, 35 | "msg": "登录成功" 36 | } 37 | ``` 38 | 39 | 40 | 41 | ### 2. 查找用户名是否存在 42 | 43 | **请求URL:** 44 | 45 | ``` 46 | /users/findUserName 47 | ``` 48 | 49 | **请求方式:** 50 | 51 | ``` 52 | Post 53 | ``` 54 | 55 | **参数说明:** 56 | 57 | | 参数 | 是否必选 | 类型 | 说明 | 58 | | :------: | :------: | :----: | :----: | 59 | | userName | 是 | string | 用户名 | 60 | 61 | **返回示例:** 62 | 63 | ```javascript 64 | { 65 | "code": "001", 66 | "msg": "用户名不存在,可以注册" 67 | } 68 | ``` 69 | 70 | 71 | 72 | ### 3. 注册 73 | 74 | **请求URL:** 75 | 76 | ``` 77 | /users/register 78 | ``` 79 | 80 | **请求方式:** 81 | 82 | ``` 83 | Post 84 | ``` 85 | 86 | **参数说明:** 87 | 88 | | 参数 | 是否必选 | 类型 | 说明 | 89 | | :------: | :------: | :----: | :----: | 90 | | userName | 是 | string | 用户名 | 91 | | password | 是 | string | 密码 | 92 | 93 | **返回示例:** 94 | 95 | ```javascript 96 | { 97 | code: '001', 98 | msg: '注册成功' 99 | } 100 | ``` 101 | 102 | 103 | 104 | 未完,有空继续写。 -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "store-server", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@types/events": { 8 | "version": "3.0.0", 9 | "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", 10 | "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==" 11 | }, 12 | "@types/formidable": { 13 | "version": "1.0.31", 14 | "resolved": "https://registry.npmjs.org/@types/formidable/-/formidable-1.0.31.tgz", 15 | "integrity": "sha512-dIhM5t8lRP0oWe2HF8MuPvdd1TpPTjhDMAqemcq6oIZQCBQTovhBAdTQ5L5veJB4pdQChadmHuxtB0YzqvfU3Q==", 16 | "requires": { 17 | "@types/events": "*", 18 | "@types/node": "*" 19 | } 20 | }, 21 | "@types/node": { 22 | "version": "12.12.14", 23 | "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.14.tgz", 24 | "integrity": "sha512-u/SJDyXwuihpwjXy7hOOghagLEV1KdAST6syfnOk6QZAMzZuWZqXy5aYYZbh8Jdpd4escVFP0MvftHNDb9pruA==" 25 | }, 26 | "accepts": { 27 | "version": "1.3.7", 28 | "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", 29 | "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", 30 | "requires": { 31 | "mime-types": "~2.1.24", 32 | "negotiator": "0.6.2" 33 | } 34 | }, 35 | "ajv": { 36 | "version": "6.12.0", 37 | "resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.0.tgz", 38 | "integrity": "sha1-BtYLlth7hFSlrauobnhU2mKdtLc=", 39 | "requires": { 40 | "fast-deep-equal": "^3.1.1", 41 | "fast-json-stable-stringify": "^2.0.0", 42 | "json-schema-traverse": "^0.4.1", 43 | "uri-js": "^4.2.2" 44 | } 45 | }, 46 | "any-promise": { 47 | "version": "1.3.0", 48 | "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", 49 | "integrity": "sha1-q8av7tzqUugJzcA3au0845Y10X8=" 50 | }, 51 | "asn1": { 52 | "version": "0.2.4", 53 | "resolved": "https://registry.npm.taobao.org/asn1/download/asn1-0.2.4.tgz", 54 | "integrity": "sha1-jSR136tVO7M+d7VOWeiAu4ziMTY=", 55 | "requires": { 56 | "safer-buffer": "~2.1.0" 57 | } 58 | }, 59 | "assert-plus": { 60 | "version": "1.0.0", 61 | "resolved": "https://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz", 62 | "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" 63 | }, 64 | "asynckit": { 65 | "version": "0.4.0", 66 | "resolved": "https://registry.npm.taobao.org/asynckit/download/asynckit-0.4.0.tgz", 67 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 68 | }, 69 | "aws-sign2": { 70 | "version": "0.7.0", 71 | "resolved": "https://registry.npm.taobao.org/aws-sign2/download/aws-sign2-0.7.0.tgz", 72 | "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" 73 | }, 74 | "aws4": { 75 | "version": "1.9.1", 76 | "resolved": "https://registry.npm.taobao.org/aws4/download/aws4-1.9.1.tgz", 77 | "integrity": "sha1-fjPY99RJs/ZzzXLeuavcVS2+Uo4=" 78 | }, 79 | "base64-js": { 80 | "version": "1.3.1", 81 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", 82 | "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" 83 | }, 84 | "bcrypt-pbkdf": { 85 | "version": "1.0.2", 86 | "resolved": "https://registry.npm.taobao.org/bcrypt-pbkdf/download/bcrypt-pbkdf-1.0.2.tgz", 87 | "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", 88 | "requires": { 89 | "tweetnacl": "^0.14.3" 90 | } 91 | }, 92 | "bignumber.js": { 93 | "version": "7.2.1", 94 | "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-7.2.1.tgz", 95 | "integrity": "sha512-S4XzBk5sMB+Rcb/LNcpzXr57VRTxgAvaAEDAl1AwRx27j00hT84O6OkteE7u8UB3NuaaygCRrEpqox4uDOrbdQ==" 96 | }, 97 | "bluebird": { 98 | "version": "3.7.2", 99 | "resolved": "https://registry.npm.taobao.org/bluebird/download/bluebird-3.7.2.tgz", 100 | "integrity": "sha1-nyKcFb4nJFT/qXOs4NvueaGww28=" 101 | }, 102 | "buffer": { 103 | "version": "5.4.3", 104 | "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.4.3.tgz", 105 | "integrity": "sha512-zvj65TkFeIt3i6aj5bIvJDzjjQQGs4o/sNoezg1F1kYap9Nu2jcUdpwzRSJTHMMzG0H7bZkn4rNQpImhuxWX2A==", 106 | "requires": { 107 | "base64-js": "^1.0.2", 108 | "ieee754": "^1.1.4" 109 | } 110 | }, 111 | "bytes": { 112 | "version": "3.1.0", 113 | "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", 114 | "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==" 115 | }, 116 | "cache-content-type": { 117 | "version": "1.0.1", 118 | "resolved": "https://registry.npmjs.org/cache-content-type/-/cache-content-type-1.0.1.tgz", 119 | "integrity": "sha512-IKufZ1o4Ut42YUrZSo8+qnMTrFuKkvyoLXUywKz9GJ5BrhOFGhLdkx9sG4KAnVvbY6kEcSFjLQul+DVmBm2bgA==", 120 | "requires": { 121 | "mime-types": "^2.1.18", 122 | "ylru": "^1.2.0" 123 | } 124 | }, 125 | "caseless": { 126 | "version": "0.12.0", 127 | "resolved": "https://registry.npm.taobao.org/caseless/download/caseless-0.12.0.tgz", 128 | "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" 129 | }, 130 | "co": { 131 | "version": "4.6.0", 132 | "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", 133 | "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" 134 | }, 135 | "co-body": { 136 | "version": "5.2.0", 137 | "resolved": "https://registry.npmjs.org/co-body/-/co-body-5.2.0.tgz", 138 | "integrity": "sha512-sX/LQ7LqUhgyaxzbe7IqwPeTr2yfpfUIQ/dgpKo6ZI4y4lpQA0YxAomWIY+7I7rHWcG02PG+OuPREzMW/5tszQ==", 139 | "requires": { 140 | "inflation": "^2.0.0", 141 | "qs": "^6.4.0", 142 | "raw-body": "^2.2.0", 143 | "type-is": "^1.6.14" 144 | } 145 | }, 146 | "combined-stream": { 147 | "version": "1.0.8", 148 | "resolved": "https://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.8.tgz", 149 | "integrity": "sha1-w9RaizT9cwYxoRCoolIGgrMdWn8=", 150 | "requires": { 151 | "delayed-stream": "~1.0.0" 152 | } 153 | }, 154 | "content-disposition": { 155 | "version": "0.5.3", 156 | "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", 157 | "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", 158 | "requires": { 159 | "safe-buffer": "5.1.2" 160 | } 161 | }, 162 | "content-type": { 163 | "version": "1.0.4", 164 | "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", 165 | "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" 166 | }, 167 | "cookies": { 168 | "version": "0.8.0", 169 | "resolved": "https://registry.npmjs.org/cookies/-/cookies-0.8.0.tgz", 170 | "integrity": "sha512-8aPsApQfebXnuI+537McwYsDtjVxGm8gTIzQI3FDW6t5t/DAhERxtnbEPN/8RX+uZthoz4eCOgloXaE5cYyNow==", 171 | "requires": { 172 | "depd": "~2.0.0", 173 | "keygrip": "~1.1.0" 174 | }, 175 | "dependencies": { 176 | "depd": { 177 | "version": "2.0.0", 178 | "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", 179 | "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" 180 | } 181 | } 182 | }, 183 | "core-util-is": { 184 | "version": "1.0.2", 185 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", 186 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" 187 | }, 188 | "crc": { 189 | "version": "3.8.0", 190 | "resolved": "https://registry.npmjs.org/crc/-/crc-3.8.0.tgz", 191 | "integrity": "sha512-iX3mfgcTMIq3ZKLIsVFAbv7+Mc10kxabAGQb8HvjA1o3T1PIYprbakQ65d3I+2HGHt6nSKkM9PYjgoJO2KcFBQ==", 192 | "requires": { 193 | "buffer": "^5.1.0" 194 | } 195 | }, 196 | "dashdash": { 197 | "version": "1.14.1", 198 | "resolved": "https://registry.npm.taobao.org/dashdash/download/dashdash-1.14.1.tgz", 199 | "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", 200 | "requires": { 201 | "assert-plus": "^1.0.0" 202 | } 203 | }, 204 | "debug": { 205 | "version": "3.1.0", 206 | "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", 207 | "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", 208 | "requires": { 209 | "ms": "2.0.0" 210 | } 211 | }, 212 | "deep-equal": { 213 | "version": "1.0.1", 214 | "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", 215 | "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=" 216 | }, 217 | "delayed-stream": { 218 | "version": "1.0.0", 219 | "resolved": "https://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz", 220 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 221 | }, 222 | "delegates": { 223 | "version": "1.0.0", 224 | "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", 225 | "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=" 226 | }, 227 | "depd": { 228 | "version": "1.1.2", 229 | "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", 230 | "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" 231 | }, 232 | "destroy": { 233 | "version": "1.0.4", 234 | "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", 235 | "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" 236 | }, 237 | "ecc-jsbn": { 238 | "version": "0.1.2", 239 | "resolved": "https://registry.npm.taobao.org/ecc-jsbn/download/ecc-jsbn-0.1.2.tgz", 240 | "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", 241 | "requires": { 242 | "jsbn": "~0.1.0", 243 | "safer-buffer": "^2.1.0" 244 | } 245 | }, 246 | "ee-first": { 247 | "version": "1.1.1", 248 | "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", 249 | "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" 250 | }, 251 | "encodeurl": { 252 | "version": "1.0.2", 253 | "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", 254 | "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" 255 | }, 256 | "error-inject": { 257 | "version": "1.0.0", 258 | "resolved": "https://registry.npmjs.org/error-inject/-/error-inject-1.0.0.tgz", 259 | "integrity": "sha1-4rPZG1Su1nLzCdlQ0VSFD6EdTzc=" 260 | }, 261 | "escape-html": { 262 | "version": "1.0.3", 263 | "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", 264 | "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" 265 | }, 266 | "extend": { 267 | "version": "3.0.2", 268 | "resolved": "https://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz", 269 | "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo=" 270 | }, 271 | "extsprintf": { 272 | "version": "1.3.0", 273 | "resolved": "https://registry.npm.taobao.org/extsprintf/download/extsprintf-1.3.0.tgz", 274 | "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" 275 | }, 276 | "fast-deep-equal": { 277 | "version": "3.1.1", 278 | "resolved": "https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-3.1.1.tgz", 279 | "integrity": "sha1-VFFFB3xQFJHjOxXsQIwpQ3bpSuQ=" 280 | }, 281 | "fast-json-stable-stringify": { 282 | "version": "2.1.0", 283 | "resolved": "https://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.1.0.tgz", 284 | "integrity": "sha1-h0v2nG9ATCtdmcSBNBOZ/VWJJjM=" 285 | }, 286 | "forever-agent": { 287 | "version": "0.6.1", 288 | "resolved": "https://registry.npm.taobao.org/forever-agent/download/forever-agent-0.6.1.tgz", 289 | "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" 290 | }, 291 | "form-data": { 292 | "version": "2.3.3", 293 | "resolved": "https://registry.npm.taobao.org/form-data/download/form-data-2.3.3.tgz", 294 | "integrity": "sha1-3M5SwF9kTymManq5Nr1yTO/786Y=", 295 | "requires": { 296 | "asynckit": "^0.4.0", 297 | "combined-stream": "^1.0.6", 298 | "mime-types": "^2.1.12" 299 | } 300 | }, 301 | "formidable": { 302 | "version": "1.2.1", 303 | "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.1.tgz", 304 | "integrity": "sha512-Fs9VRguL0gqGHkXS5GQiMCr1VhZBxz0JnJs4JmMp/2jL18Fmbzvv7vOFRU+U8TBkHEE/CX1qDXzJplVULgsLeg==" 305 | }, 306 | "fresh": { 307 | "version": "0.5.2", 308 | "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", 309 | "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" 310 | }, 311 | "getpass": { 312 | "version": "0.1.7", 313 | "resolved": "https://registry.npm.taobao.org/getpass/download/getpass-0.1.7.tgz", 314 | "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", 315 | "requires": { 316 | "assert-plus": "^1.0.0" 317 | } 318 | }, 319 | "har-schema": { 320 | "version": "2.0.0", 321 | "resolved": "https://registry.npm.taobao.org/har-schema/download/har-schema-2.0.0.tgz", 322 | "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" 323 | }, 324 | "har-validator": { 325 | "version": "5.1.3", 326 | "resolved": "https://registry.npm.taobao.org/har-validator/download/har-validator-5.1.3.tgz", 327 | "integrity": "sha1-HvievT5JllV2de7ZiTEQ3DUPoIA=", 328 | "requires": { 329 | "ajv": "^6.5.5", 330 | "har-schema": "^2.0.0" 331 | } 332 | }, 333 | "http-assert": { 334 | "version": "1.4.1", 335 | "resolved": "https://registry.npmjs.org/http-assert/-/http-assert-1.4.1.tgz", 336 | "integrity": "sha512-rdw7q6GTlibqVVbXr0CKelfV5iY8G2HqEUkhSk297BMbSpSL8crXC+9rjKoMcZZEsksX30le6f/4ul4E28gegw==", 337 | "requires": { 338 | "deep-equal": "~1.0.1", 339 | "http-errors": "~1.7.2" 340 | } 341 | }, 342 | "http-errors": { 343 | "version": "1.7.3", 344 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.3.tgz", 345 | "integrity": "sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw==", 346 | "requires": { 347 | "depd": "~1.1.2", 348 | "inherits": "2.0.4", 349 | "setprototypeof": "1.1.1", 350 | "statuses": ">= 1.5.0 < 2", 351 | "toidentifier": "1.0.0" 352 | } 353 | }, 354 | "http-signature": { 355 | "version": "1.2.0", 356 | "resolved": "https://registry.npm.taobao.org/http-signature/download/http-signature-1.2.0.tgz", 357 | "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", 358 | "requires": { 359 | "assert-plus": "^1.0.0", 360 | "jsprim": "^1.2.2", 361 | "sshpk": "^1.7.0" 362 | } 363 | }, 364 | "iconv-lite": { 365 | "version": "0.4.24", 366 | "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", 367 | "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", 368 | "requires": { 369 | "safer-buffer": ">= 2.1.2 < 3" 370 | } 371 | }, 372 | "ieee754": { 373 | "version": "1.1.13", 374 | "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", 375 | "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" 376 | }, 377 | "inflation": { 378 | "version": "2.0.0", 379 | "resolved": "https://registry.npmjs.org/inflation/-/inflation-2.0.0.tgz", 380 | "integrity": "sha1-i0F+R8KPklpFEz2RTKH9OJEH8w8=" 381 | }, 382 | "inherits": { 383 | "version": "2.0.4", 384 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", 385 | "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" 386 | }, 387 | "is-class-hotfix": { 388 | "version": "0.0.6", 389 | "resolved": "https://registry.npmjs.org/is-class-hotfix/-/is-class-hotfix-0.0.6.tgz", 390 | "integrity": "sha512-0n+pzCC6ICtVr/WXnN2f03TK/3BfXY7me4cjCAqT8TYXEl0+JBRoqBo94JJHXcyDSLUeWbNX8Fvy5g5RJdAstQ==" 391 | }, 392 | "is-generator-function": { 393 | "version": "1.0.7", 394 | "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.7.tgz", 395 | "integrity": "sha512-YZc5EwyO4f2kWCax7oegfuSr9mFz1ZvieNYBEjmukLxgXfBUbxAWGVF7GZf0zidYtoBl3WvC07YK0wT76a+Rtw==" 396 | }, 397 | "is-type-of": { 398 | "version": "1.2.1", 399 | "resolved": "https://registry.npmjs.org/is-type-of/-/is-type-of-1.2.1.tgz", 400 | "integrity": "sha512-uK0kyX9LZYhSDS7H2sVJQJop1UnWPWmo5RvR3q2kFH6AUHYs7sOrVg0b4nyBHw29kRRNFofYN/JbHZDlHiItTA==", 401 | "requires": { 402 | "core-util-is": "^1.0.2", 403 | "is-class-hotfix": "~0.0.6", 404 | "isstream": "~0.1.2" 405 | } 406 | }, 407 | "is-typedarray": { 408 | "version": "1.0.0", 409 | "resolved": "https://registry.npm.taobao.org/is-typedarray/download/is-typedarray-1.0.0.tgz", 410 | "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" 411 | }, 412 | "isarray": { 413 | "version": "0.0.1", 414 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", 415 | "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" 416 | }, 417 | "isstream": { 418 | "version": "0.1.2", 419 | "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", 420 | "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" 421 | }, 422 | "jsbn": { 423 | "version": "0.1.1", 424 | "resolved": "https://registry.npm.taobao.org/jsbn/download/jsbn-0.1.1.tgz", 425 | "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" 426 | }, 427 | "json-schema": { 428 | "version": "0.2.3", 429 | "resolved": "https://registry.npm.taobao.org/json-schema/download/json-schema-0.2.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjson-schema%2Fdownload%2Fjson-schema-0.2.3.tgz", 430 | "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" 431 | }, 432 | "json-schema-traverse": { 433 | "version": "0.4.1", 434 | "resolved": "https://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.4.1.tgz", 435 | "integrity": "sha1-afaofZUTq4u4/mO9sJecRI5oRmA=" 436 | }, 437 | "json-stringify-safe": { 438 | "version": "5.0.1", 439 | "resolved": "https://registry.npm.taobao.org/json-stringify-safe/download/json-stringify-safe-5.0.1.tgz", 440 | "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" 441 | }, 442 | "jsprim": { 443 | "version": "1.4.1", 444 | "resolved": "https://registry.npm.taobao.org/jsprim/download/jsprim-1.4.1.tgz", 445 | "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", 446 | "requires": { 447 | "assert-plus": "1.0.0", 448 | "extsprintf": "1.3.0", 449 | "json-schema": "0.2.3", 450 | "verror": "1.10.0" 451 | } 452 | }, 453 | "keygrip": { 454 | "version": "1.1.0", 455 | "resolved": "https://registry.npmjs.org/keygrip/-/keygrip-1.1.0.tgz", 456 | "integrity": "sha512-iYSchDJ+liQ8iwbSI2QqsQOvqv58eJCEanyJPJi+Khyu8smkcKSFUCbPwzFcL7YVtZ6eONjqRX/38caJ7QjRAQ==", 457 | "requires": { 458 | "tsscmp": "1.0.6" 459 | } 460 | }, 461 | "koa": { 462 | "version": "2.11.0", 463 | "resolved": "https://registry.npmjs.org/koa/-/koa-2.11.0.tgz", 464 | "integrity": "sha512-EpR9dElBTDlaDgyhDMiLkXrPwp6ZqgAIBvhhmxQ9XN4TFgW+gEz6tkcsNI6BnUbUftrKDjVFj4lW2/J2aNBMMA==", 465 | "requires": { 466 | "accepts": "^1.3.5", 467 | "cache-content-type": "^1.0.0", 468 | "content-disposition": "~0.5.2", 469 | "content-type": "^1.0.4", 470 | "cookies": "~0.8.0", 471 | "debug": "~3.1.0", 472 | "delegates": "^1.0.0", 473 | "depd": "^1.1.2", 474 | "destroy": "^1.0.4", 475 | "encodeurl": "^1.0.2", 476 | "error-inject": "^1.0.0", 477 | "escape-html": "^1.0.3", 478 | "fresh": "~0.5.2", 479 | "http-assert": "^1.3.0", 480 | "http-errors": "^1.6.3", 481 | "is-generator-function": "^1.0.7", 482 | "koa-compose": "^4.1.0", 483 | "koa-convert": "^1.2.0", 484 | "on-finished": "^2.3.0", 485 | "only": "~0.0.2", 486 | "parseurl": "^1.3.2", 487 | "statuses": "^1.5.0", 488 | "type-is": "^1.6.16", 489 | "vary": "^1.1.2" 490 | } 491 | }, 492 | "koa-body": { 493 | "version": "4.1.1", 494 | "resolved": "https://registry.npmjs.org/koa-body/-/koa-body-4.1.1.tgz", 495 | "integrity": "sha512-rLb/KVD8qplEcK8Qsu6F4Xw+uHkmx3MWogDVmMX07DpjXizhw3pOEp1ja1MqqAcl0ei75AsrbGVDlySmsUrreA==", 496 | "requires": { 497 | "@types/formidable": "^1.0.31", 498 | "co-body": "^5.1.1", 499 | "formidable": "^1.1.1" 500 | } 501 | }, 502 | "koa-compose": { 503 | "version": "4.1.0", 504 | "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-4.1.0.tgz", 505 | "integrity": "sha512-8ODW8TrDuMYvXRwra/Kh7/rJo9BtOfPc6qO8eAfC80CnCvSjSl0bkRM24X6/XBBEyj0v1nRUQ1LyOy3dbqOWXw==" 506 | }, 507 | "koa-convert": { 508 | "version": "1.2.0", 509 | "resolved": "https://registry.npmjs.org/koa-convert/-/koa-convert-1.2.0.tgz", 510 | "integrity": "sha1-2kCHXfSd4FOQmNFwC1CCDOvNIdA=", 511 | "requires": { 512 | "co": "^4.6.0", 513 | "koa-compose": "^3.0.0" 514 | }, 515 | "dependencies": { 516 | "koa-compose": { 517 | "version": "3.2.1", 518 | "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-3.2.1.tgz", 519 | "integrity": "sha1-qFzLQLfZhtjlo0Wzoazo6rz1Tec=", 520 | "requires": { 521 | "any-promise": "^1.1.0" 522 | } 523 | } 524 | } 525 | }, 526 | "koa-router": { 527 | "version": "7.4.0", 528 | "resolved": "https://registry.npmjs.org/koa-router/-/koa-router-7.4.0.tgz", 529 | "integrity": "sha512-IWhaDXeAnfDBEpWS6hkGdZ1ablgr6Q6pGdXCyK38RbzuH4LkUOpPqPw+3f8l8aTDrQmBQ7xJc0bs2yV4dzcO+g==", 530 | "requires": { 531 | "debug": "^3.1.0", 532 | "http-errors": "^1.3.1", 533 | "koa-compose": "^3.0.0", 534 | "methods": "^1.0.1", 535 | "path-to-regexp": "^1.1.1", 536 | "urijs": "^1.19.0" 537 | }, 538 | "dependencies": { 539 | "koa-compose": { 540 | "version": "3.2.1", 541 | "resolved": "https://registry.npmjs.org/koa-compose/-/koa-compose-3.2.1.tgz", 542 | "integrity": "sha1-qFzLQLfZhtjlo0Wzoazo6rz1Tec=", 543 | "requires": { 544 | "any-promise": "^1.1.0" 545 | } 546 | } 547 | } 548 | }, 549 | "koa-send": { 550 | "version": "5.0.0", 551 | "resolved": "https://registry.npmjs.org/koa-send/-/koa-send-5.0.0.tgz", 552 | "integrity": "sha512-90ZotV7t0p3uN9sRwW2D484rAaKIsD8tAVtypw/aBU+ryfV+fR2xrcAwhI8Wl6WRkojLUs/cB9SBSCuIb+IanQ==", 553 | "requires": { 554 | "debug": "^3.1.0", 555 | "http-errors": "^1.6.3", 556 | "mz": "^2.7.0", 557 | "resolve-path": "^1.4.0" 558 | } 559 | }, 560 | "koa-session": { 561 | "version": "5.12.3", 562 | "resolved": "https://registry.npmjs.org/koa-session/-/koa-session-5.12.3.tgz", 563 | "integrity": "sha512-r1vRerk6z+J54TtgXPG+oYGj1vwrd889bz55hS7VykWvbtmPNb0q/N7arOHGV8dnstlRyZPP3xCJL20wIf9LwA==", 564 | "requires": { 565 | "crc": "^3.4.4", 566 | "debug": "^3.1.0", 567 | "is-type-of": "^1.0.0", 568 | "uuid": "^3.3.2" 569 | } 570 | }, 571 | "koa-static": { 572 | "version": "5.0.0", 573 | "resolved": "https://registry.npmjs.org/koa-static/-/koa-static-5.0.0.tgz", 574 | "integrity": "sha512-UqyYyH5YEXaJrf9S8E23GoJFQZXkBVJ9zYYMPGz919MSX1KuvAcycIuS0ci150HCoPf4XQVhQ84Qf8xRPWxFaQ==", 575 | "requires": { 576 | "debug": "^3.1.0", 577 | "koa-send": "^5.0.0" 578 | } 579 | }, 580 | "lodash": { 581 | "version": "4.17.15", 582 | "resolved": "https://registry.npm.taobao.org/lodash/download/lodash-4.17.15.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flodash%2Fdownload%2Flodash-4.17.15.tgz", 583 | "integrity": "sha1-tEf2ZwoEVbv+7dETku/zMOoJdUg=" 584 | }, 585 | "media-typer": { 586 | "version": "0.3.0", 587 | "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", 588 | "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" 589 | }, 590 | "methods": { 591 | "version": "1.1.2", 592 | "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", 593 | "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" 594 | }, 595 | "mime-db": { 596 | "version": "1.42.0", 597 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.42.0.tgz", 598 | "integrity": "sha512-UbfJCR4UAVRNgMpfImz05smAXK7+c+ZntjaA26ANtkXLlOe947Aag5zdIcKQULAiF9Cq4WxBi9jUs5zkA84bYQ==" 599 | }, 600 | "mime-types": { 601 | "version": "2.1.25", 602 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.25.tgz", 603 | "integrity": "sha512-5KhStqB5xpTAeGqKBAMgwaYMnQik7teQN4IAzC7npDv6kzeU6prfkR67bc87J1kWMPGkoaZSq1npmexMgkmEVg==", 604 | "requires": { 605 | "mime-db": "1.42.0" 606 | } 607 | }, 608 | "ms": { 609 | "version": "2.0.0", 610 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", 611 | "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" 612 | }, 613 | "mysql": { 614 | "version": "2.17.1", 615 | "resolved": "https://registry.npmjs.org/mysql/-/mysql-2.17.1.tgz", 616 | "integrity": "sha512-7vMqHQ673SAk5C8fOzTG2LpPcf3bNt0oL3sFpxPEEFp1mdlDcrLK0On7z8ZYKaaHrHwNcQ/MTUz7/oobZ2OyyA==", 617 | "requires": { 618 | "bignumber.js": "7.2.1", 619 | "readable-stream": "2.3.6", 620 | "safe-buffer": "5.1.2", 621 | "sqlstring": "2.3.1" 622 | } 623 | }, 624 | "mz": { 625 | "version": "2.7.0", 626 | "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", 627 | "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", 628 | "requires": { 629 | "any-promise": "^1.0.0", 630 | "object-assign": "^4.0.1", 631 | "thenify-all": "^1.0.0" 632 | } 633 | }, 634 | "negotiator": { 635 | "version": "0.6.2", 636 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", 637 | "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" 638 | }, 639 | "oauth-sign": { 640 | "version": "0.9.0", 641 | "resolved": "https://registry.npm.taobao.org/oauth-sign/download/oauth-sign-0.9.0.tgz", 642 | "integrity": "sha1-R6ewFrqmi1+g7PPe4IqFxnmsZFU=" 643 | }, 644 | "object-assign": { 645 | "version": "4.1.1", 646 | "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", 647 | "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" 648 | }, 649 | "on-finished": { 650 | "version": "2.3.0", 651 | "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", 652 | "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", 653 | "requires": { 654 | "ee-first": "1.1.1" 655 | } 656 | }, 657 | "only": { 658 | "version": "0.0.2", 659 | "resolved": "https://registry.npmjs.org/only/-/only-0.0.2.tgz", 660 | "integrity": "sha1-Kv3oTQPlC5qO3EROMGEKcCle37Q=" 661 | }, 662 | "parseurl": { 663 | "version": "1.3.3", 664 | "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", 665 | "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" 666 | }, 667 | "path-is-absolute": { 668 | "version": "1.0.1", 669 | "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 670 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" 671 | }, 672 | "path-to-regexp": { 673 | "version": "1.8.0", 674 | "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", 675 | "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", 676 | "requires": { 677 | "isarray": "0.0.1" 678 | } 679 | }, 680 | "performance-now": { 681 | "version": "2.1.0", 682 | "resolved": "https://registry.npm.taobao.org/performance-now/download/performance-now-2.1.0.tgz", 683 | "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" 684 | }, 685 | "process-nextick-args": { 686 | "version": "2.0.1", 687 | "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", 688 | "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" 689 | }, 690 | "psl": { 691 | "version": "1.8.0", 692 | "resolved": "https://registry.npm.taobao.org/psl/download/psl-1.8.0.tgz", 693 | "integrity": "sha1-kyb4vPsBOtzABf3/BWrM4CDlHCQ=" 694 | }, 695 | "punycode": { 696 | "version": "2.1.1", 697 | "resolved": "https://registry.npm.taobao.org/punycode/download/punycode-2.1.1.tgz", 698 | "integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew=" 699 | }, 700 | "qs": { 701 | "version": "6.9.1", 702 | "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.1.tgz", 703 | "integrity": "sha512-Cxm7/SS/y/Z3MHWSxXb8lIFqgqBowP5JMlTUFyJN88y0SGQhVmZnqFK/PeuMX9LzUyWsqqhNxIyg0jlzq946yA==" 704 | }, 705 | "raw-body": { 706 | "version": "2.4.1", 707 | "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.1.tgz", 708 | "integrity": "sha512-9WmIKF6mkvA0SLmA2Knm9+qj89e+j1zqgyn8aXGd7+nAduPoqgI9lO57SAZNn/Byzo5P7JhXTyg9PzaJbH73bA==", 709 | "requires": { 710 | "bytes": "3.1.0", 711 | "http-errors": "1.7.3", 712 | "iconv-lite": "0.4.24", 713 | "unpipe": "1.0.0" 714 | } 715 | }, 716 | "readable-stream": { 717 | "version": "2.3.6", 718 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", 719 | "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", 720 | "requires": { 721 | "core-util-is": "~1.0.0", 722 | "inherits": "~2.0.3", 723 | "isarray": "~1.0.0", 724 | "process-nextick-args": "~2.0.0", 725 | "safe-buffer": "~5.1.1", 726 | "string_decoder": "~1.1.1", 727 | "util-deprecate": "~1.0.1" 728 | }, 729 | "dependencies": { 730 | "isarray": { 731 | "version": "1.0.0", 732 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", 733 | "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" 734 | } 735 | } 736 | }, 737 | "request": { 738 | "version": "2.88.2", 739 | "resolved": "https://registry.npm.taobao.org/request/download/request-2.88.2.tgz", 740 | "integrity": "sha1-1zyRhzHLWofaBH4gcjQUb2ZNErM=", 741 | "requires": { 742 | "aws-sign2": "~0.7.0", 743 | "aws4": "^1.8.0", 744 | "caseless": "~0.12.0", 745 | "combined-stream": "~1.0.6", 746 | "extend": "~3.0.2", 747 | "forever-agent": "~0.6.1", 748 | "form-data": "~2.3.2", 749 | "har-validator": "~5.1.3", 750 | "http-signature": "~1.2.0", 751 | "is-typedarray": "~1.0.0", 752 | "isstream": "~0.1.2", 753 | "json-stringify-safe": "~5.0.1", 754 | "mime-types": "~2.1.19", 755 | "oauth-sign": "~0.9.0", 756 | "performance-now": "^2.1.0", 757 | "qs": "~6.5.2", 758 | "safe-buffer": "^5.1.2", 759 | "tough-cookie": "~2.5.0", 760 | "tunnel-agent": "^0.6.0", 761 | "uuid": "^3.3.2" 762 | }, 763 | "dependencies": { 764 | "qs": { 765 | "version": "6.5.2", 766 | "resolved": "https://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz?cache=0&sync_timestamp=1585168908480&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fqs%2Fdownload%2Fqs-6.5.2.tgz", 767 | "integrity": "sha1-yzroBuh0BERYTvFUzo7pjUA/PjY=" 768 | } 769 | } 770 | }, 771 | "request-promise": { 772 | "version": "4.2.5", 773 | "resolved": "https://registry.npm.taobao.org/request-promise/download/request-promise-4.2.5.tgz", 774 | "integrity": "sha1-GGIixZrlEvNJff5NdanIRhvQBTw=", 775 | "requires": { 776 | "bluebird": "^3.5.0", 777 | "request-promise-core": "1.1.3", 778 | "stealthy-require": "^1.1.1", 779 | "tough-cookie": "^2.3.3" 780 | } 781 | }, 782 | "request-promise-core": { 783 | "version": "1.1.3", 784 | "resolved": "https://registry.npm.taobao.org/request-promise-core/download/request-promise-core-1.1.3.tgz", 785 | "integrity": "sha1-6aPAgbUTgN/qZ3M2Bh/qh5qCnuk=", 786 | "requires": { 787 | "lodash": "^4.17.15" 788 | } 789 | }, 790 | "resolve-path": { 791 | "version": "1.4.0", 792 | "resolved": "https://registry.npmjs.org/resolve-path/-/resolve-path-1.4.0.tgz", 793 | "integrity": "sha1-xL2p9e+y/OZSR4c6s2u02DT+Fvc=", 794 | "requires": { 795 | "http-errors": "~1.6.2", 796 | "path-is-absolute": "1.0.1" 797 | }, 798 | "dependencies": { 799 | "http-errors": { 800 | "version": "1.6.3", 801 | "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz", 802 | "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=", 803 | "requires": { 804 | "depd": "~1.1.2", 805 | "inherits": "2.0.3", 806 | "setprototypeof": "1.1.0", 807 | "statuses": ">= 1.4.0 < 2" 808 | } 809 | }, 810 | "inherits": { 811 | "version": "2.0.3", 812 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 813 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" 814 | }, 815 | "setprototypeof": { 816 | "version": "1.1.0", 817 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz", 818 | "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ==" 819 | } 820 | } 821 | }, 822 | "safe-buffer": { 823 | "version": "5.1.2", 824 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", 825 | "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" 826 | }, 827 | "safer-buffer": { 828 | "version": "2.1.2", 829 | "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", 830 | "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" 831 | }, 832 | "setprototypeof": { 833 | "version": "1.1.1", 834 | "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", 835 | "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" 836 | }, 837 | "sqlstring": { 838 | "version": "2.3.1", 839 | "resolved": "https://registry.npmjs.org/sqlstring/-/sqlstring-2.3.1.tgz", 840 | "integrity": "sha1-R1OT/56RR5rqYtyvDKPRSYOn+0A=" 841 | }, 842 | "sshpk": { 843 | "version": "1.16.1", 844 | "resolved": "https://registry.npm.taobao.org/sshpk/download/sshpk-1.16.1.tgz", 845 | "integrity": "sha1-+2YcC+8ps520B2nuOfpwCT1vaHc=", 846 | "requires": { 847 | "asn1": "~0.2.3", 848 | "assert-plus": "^1.0.0", 849 | "bcrypt-pbkdf": "^1.0.0", 850 | "dashdash": "^1.12.0", 851 | "ecc-jsbn": "~0.1.1", 852 | "getpass": "^0.1.1", 853 | "jsbn": "~0.1.0", 854 | "safer-buffer": "^2.0.2", 855 | "tweetnacl": "~0.14.0" 856 | } 857 | }, 858 | "statuses": { 859 | "version": "1.5.0", 860 | "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", 861 | "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" 862 | }, 863 | "stealthy-require": { 864 | "version": "1.1.1", 865 | "resolved": "https://registry.npm.taobao.org/stealthy-require/download/stealthy-require-1.1.1.tgz", 866 | "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" 867 | }, 868 | "string_decoder": { 869 | "version": "1.1.1", 870 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", 871 | "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", 872 | "requires": { 873 | "safe-buffer": "~5.1.0" 874 | } 875 | }, 876 | "thenify": { 877 | "version": "3.3.0", 878 | "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.0.tgz", 879 | "integrity": "sha1-5p44obq+lpsBCCB5eLn2K4hgSDk=", 880 | "requires": { 881 | "any-promise": "^1.0.0" 882 | } 883 | }, 884 | "thenify-all": { 885 | "version": "1.6.0", 886 | "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", 887 | "integrity": "sha1-GhkY1ALY/D+Y+/I02wvMjMEOlyY=", 888 | "requires": { 889 | "thenify": ">= 3.1.0 < 4" 890 | } 891 | }, 892 | "toidentifier": { 893 | "version": "1.0.0", 894 | "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", 895 | "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" 896 | }, 897 | "tough-cookie": { 898 | "version": "2.5.0", 899 | "resolved": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.5.0.tgz", 900 | "integrity": "sha1-zZ+yoKodWhK0c72fuW+j3P9lreI=", 901 | "requires": { 902 | "psl": "^1.1.28", 903 | "punycode": "^2.1.1" 904 | } 905 | }, 906 | "tsscmp": { 907 | "version": "1.0.6", 908 | "resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz", 909 | "integrity": "sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA==" 910 | }, 911 | "tunnel-agent": { 912 | "version": "0.6.0", 913 | "resolved": "https://registry.npm.taobao.org/tunnel-agent/download/tunnel-agent-0.6.0.tgz", 914 | "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", 915 | "requires": { 916 | "safe-buffer": "^5.0.1" 917 | } 918 | }, 919 | "tweetnacl": { 920 | "version": "0.14.5", 921 | "resolved": "https://registry.npm.taobao.org/tweetnacl/download/tweetnacl-0.14.5.tgz", 922 | "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" 923 | }, 924 | "type-is": { 925 | "version": "1.6.18", 926 | "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", 927 | "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", 928 | "requires": { 929 | "media-typer": "0.3.0", 930 | "mime-types": "~2.1.24" 931 | } 932 | }, 933 | "unpipe": { 934 | "version": "1.0.0", 935 | "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", 936 | "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" 937 | }, 938 | "uri-js": { 939 | "version": "4.2.2", 940 | "resolved": "https://registry.npm.taobao.org/uri-js/download/uri-js-4.2.2.tgz", 941 | "integrity": "sha1-lMVA4f93KVbiKZUHwBCupsiDjrA=", 942 | "requires": { 943 | "punycode": "^2.1.0" 944 | } 945 | }, 946 | "urijs": { 947 | "version": "1.19.2", 948 | "resolved": "https://registry.npmjs.org/urijs/-/urijs-1.19.2.tgz", 949 | "integrity": "sha512-s/UIq9ap4JPZ7H1EB5ULo/aOUbWqfDi7FKzMC2Nz+0Si8GiT1rIEaprt8hy3Vy2Ex2aJPpOQv4P4DuOZ+K1c6w==" 950 | }, 951 | "util-deprecate": { 952 | "version": "1.0.2", 953 | "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", 954 | "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" 955 | }, 956 | "uuid": { 957 | "version": "3.3.3", 958 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.3.tgz", 959 | "integrity": "sha512-pW0No1RGHgzlpHJO1nsVrHKpOEIxkGg1xB+v0ZmdNH5OAeAwzAVrCnI2/6Mtx+Uys6iaylxa+D3g4j63IKKjSQ==" 960 | }, 961 | "vary": { 962 | "version": "1.1.2", 963 | "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", 964 | "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" 965 | }, 966 | "verror": { 967 | "version": "1.10.0", 968 | "resolved": "https://registry.npm.taobao.org/verror/download/verror-1.10.0.tgz", 969 | "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", 970 | "requires": { 971 | "assert-plus": "^1.0.0", 972 | "core-util-is": "1.0.2", 973 | "extsprintf": "^1.2.0" 974 | } 975 | }, 976 | "ylru": { 977 | "version": "1.2.1", 978 | "resolved": "https://registry.npmjs.org/ylru/-/ylru-1.2.1.tgz", 979 | "integrity": "sha512-faQrqNMzcPCHGVC2aaOINk13K+aaBDUPjGWl0teOXywElLjyVAB6Oe2jj62jHYtwsU49jXhScYbvPENK+6zAvQ==" 980 | } 981 | } 982 | } 983 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "store-server", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "app.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "koa": "^2.11.0", 13 | "koa-body": "^4.1.1", 14 | "koa-router": "^7.4.0", 15 | "koa-session": "^5.12.3", 16 | "koa-static": "^5.0.0", 17 | "mysql": "^2.17.1", 18 | "request": "^2.88.2", 19 | "request-promise": "^4.2.5" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /public/docs/README.md: -------------------------------------------------------------------------------- 1 | # Store(参考小米商城) 2 | 3 | ## 前言 4 | 5 | 2020年寒假尤其特殊,因为新型冠状病毒肺炎疫情,学校至今没有开学。想起上学期利用课余时间学习了`Vue.js`、`Node.js`,一直想做个完整的项目实战一下,但之前在学校并没有那么多的时间。现在恰好有时间,就想着做一个项目巩固之前学到的东西。 6 | 7 | 思来想去,最后决定模仿 [小米商城 ](www.mi.com)做一个电商项目。可能时间隔得有点久了,之前学的东西很多都差不多忘记了,做这个项目基本上都是看着官方的文档一点一点做的。在家里也免不了有各种各样的事情耽误了项目的进度。现在终于差不多做好了,分享出来,新手上路,如有错误,请多多指教。 8 | 9 | ## 说明 10 | 11 | > 本项目前后端分离,前端参考 [小米商城](www.mi.com) 实现,但与小米官方没有关系,纯属个人瞎搞,若需要购买小米产品请到小米官方商城。 12 | 13 | > 这是本项目的前端,后端请移步到[store-server](https://github.com/hai-27/store-server) 。 14 | 15 | > 前端已经部署在阿里云,欢迎访问 [http://106.15.179.105/](http://106.15.179.105/) (没有兼容移动端,请使用电脑访问)。 16 | 17 | > 后端也已经部署在阿里云,接口地址已经修改为线上地址,本地运行前端也可以正常访问后端。 18 | 19 | > 本人在读本科大三,今年暑假即将开始实习,后面的时间可能没有那么的自由,但会不定期的更新完善该项目,如有问题请直接在 Issues 中提。 20 | 21 | > 如果觉得这个项目还不错,您可以点右上角 `Star`支持一下, 谢谢! ^_^ 22 | 23 | ## 项目简介 24 | 25 | 本项目前后端分离,前端基于`Vue`+`Vue-router`+`Vuex`+`Element-ui`+`Axios`,参考小米商城实现。后端基于`Node.js(Koa框架)`+`Mysql`实现。 26 | 27 | 前端包含了11个页面:首页、登录、注册、全部商品、商品详情页、关于我们、我的收藏、购物车、订单结算页面、我的订单以及错误处理页面。 28 | 29 | 实现了商品的展示、商品分类查询、关键字搜索商品、商品详细信息展示、登录、注册、用户购物车、订单结算、用户订单、用户收藏列表以及错误处理功能。 30 | 31 | 后端采取了MVC模式,根据前端需要的数据分模块设计了相应的接口、控制层、数据持久层。后端传送地址[store-server](https://github.com/hai-27/store-server) 。 32 | 33 | ## 技术栈 34 | 35 | - **前端:**`Vue`+`Vue-router`+`Vuex`+`Element-ui`+`Axios` 36 | 37 | - **后端:**`Node.js`、`Koa框架` 38 | 39 | - **数据库:**`Mysql` 40 | 41 | ## 功能模块 42 | 43 | ### 登录 44 | 45 | 页面使用了element-ui的`Dialog`实现弹出蒙版对话框的效果,`登录`按钮设置在App.vue根组件,通过`vuex`中的`showLogin`状态控制登录框是否显示。 46 | 47 | 这样设计是为了既可以通过点击页面中的按钮登录,也可以是用户访问需要登录验证的页面或后端返回需要验证登录的提示后自动弹出登录框,减少了页面的跳转,简化用户操作。 48 | 49 | 用户输入的数据往往是不可靠的,所以本项目前后端都对登录信息进行了校验,前端基于element-ui的表单校验方式,自定义了校验规则进行校验。 50 | 51 | ### 注册 52 | 53 | 页面同样使用了element-ui的`Dialog`实现弹出蒙版对话框的效果,`注册`按钮设置在App.vue根组件,通过父子组件传值控制注册框是否显示。 54 | 55 | 用户输入的数据往往是不可靠的,所以本项目前后端同样都对注册信息进行了校验,前端基于element-ui的表单校验方式,自定义了校验规则进行校验。 56 | 57 | ### 首页 58 | 59 | 首页主要是对商品的展示,有轮播图展示推荐的商品,分类别对热门商品进行展示。 60 | 61 | ### 全部商品 62 | 63 | 全部商品页面集成了全部商品展示、商品分类查询,以及根据关键字搜索商品结果展示。 64 | 65 | ### 商品详情页 66 | 67 | 商品详情页主要是对某个商品的详细信息进行展示,用户可以在这里把喜欢的商品加入购物车或收藏列表。 68 | 69 | ### 我的购物车 70 | 71 | 购物车采用vuex实现,页面效果参考了小米商城的购物车。 72 | 73 | 详细实现过程请看:[基于Vuex实现小米商城购物车](https://github.com/hai-27/hai-27.github.io/blob/master/page/%E5%9F%BA%E4%BA%8EVuex%E5%AE%9E%E7%8E%B0%E5%B0%8F%E7%B1%B3%E5%95%86%E5%9F%8E%E8%B4%AD%E7%89%A9%E8%BD%A6.md) 74 | 75 | ### 订单结算 76 | 77 | 用户在购物车选择了准备购买的商品后,点击“去结算”按钮,会来到该页面。 78 | 用户在这里选择收货地址,确认订单的相关信息,然后确认购买。 79 | 80 | ### 我的收藏 81 | 82 | 用户在商品的详情页,可以通过点击加入 喜欢 按钮,把喜欢的商品加入到收藏列表。 83 | 84 | ### 我的订单 85 | 86 | 对用户的所有订单进行展示。 87 | 88 | ## 运行项目 89 | 90 | **注意:** 91 | 92 | - 后端接口地址已经修改为线上的地址,本地运行会直接分为我部署在服务器的后端。 93 | - 为了方便测试,数据库数据没有加密,注册时切记**不要使用自己的常用密码**。 94 | - 如果需要自己运行后端,请移步到[store-server](https://github.com/hai-27/store-server) clone后端项目,并修改前端的接口地址为您的服务器地址。 95 | 96 | ``` 97 | 1. Clone project 98 | 99 | git clone https://github.com/hai-27/vue-store.git 100 | 101 | 2. Project setup 102 | 103 | cd vue-store 104 | npm install 105 | 106 | 3. Compiles and hot-reloads for development 107 | 108 | npm run serve 109 | 110 | 4. Compiles and minifies for production 111 | 112 | npm run build 113 | ``` 114 | 115 | 116 | **作者** [hai-27](https://github.com/hai-27) 117 | 118 | 2020年3月8日 -------------------------------------------------------------------------------- /public/imgs/accessory/accessory-promo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/accessory/accessory-promo1.png -------------------------------------------------------------------------------- /public/imgs/accessory/accessory-promo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/accessory/accessory-promo2.png -------------------------------------------------------------------------------- /public/imgs/accessory/charger-10000mAh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/accessory/charger-10000mAh.png -------------------------------------------------------------------------------- /public/imgs/accessory/charger-18w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/accessory/charger-18w.png -------------------------------------------------------------------------------- /public/imgs/accessory/charger-30w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/accessory/charger-30w.png -------------------------------------------------------------------------------- /public/imgs/accessory/charger-36w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/accessory/charger-36w.png -------------------------------------------------------------------------------- /public/imgs/accessory/charger-60w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/accessory/charger-60w.png -------------------------------------------------------------------------------- /public/imgs/accessory/charger-car-37w.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/accessory/charger-car-37w.png -------------------------------------------------------------------------------- /public/imgs/accessory/charger-car.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/accessory/charger-car.png -------------------------------------------------------------------------------- /public/imgs/accessory/charger-tio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/accessory/charger-tio.png -------------------------------------------------------------------------------- /public/imgs/accessory/protectingMen-Mi-CC9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/accessory/protectingMen-Mi-CC9.png -------------------------------------------------------------------------------- /public/imgs/accessory/protectingMen-Mi-CC9e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/accessory/protectingMen-Mi-CC9e.png -------------------------------------------------------------------------------- /public/imgs/accessory/protectingShell-Mi-9-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/accessory/protectingShell-Mi-9-red.png -------------------------------------------------------------------------------- /public/imgs/accessory/protectingShell-Mi-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/accessory/protectingShell-Mi-9.png -------------------------------------------------------------------------------- /public/imgs/accessory/protectingShell-Mi-9SE.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/accessory/protectingShell-Mi-9SE.png -------------------------------------------------------------------------------- /public/imgs/accessory/protectingShell-Mi-CC9Pro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/accessory/protectingShell-Mi-CC9Pro.png -------------------------------------------------------------------------------- /public/imgs/accessory/protectingShell-Mix-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/accessory/protectingShell-Mix-3.png -------------------------------------------------------------------------------- /public/imgs/accessory/protectingShell-RedMi-K20&pro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/accessory/protectingShell-RedMi-K20&pro.png -------------------------------------------------------------------------------- /public/imgs/accessory/protectingShell-RedMi-K20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/accessory/protectingShell-RedMi-K20.png -------------------------------------------------------------------------------- /public/imgs/appliance/AirCondition-F3W1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/appliance/AirCondition-F3W1.png -------------------------------------------------------------------------------- /public/imgs/appliance/AirCondition-V1C1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/appliance/AirCondition-V1C1.png -------------------------------------------------------------------------------- /public/imgs/appliance/MiTv-4A-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/appliance/MiTv-4A-32.png -------------------------------------------------------------------------------- /public/imgs/appliance/MiTv-4A-65.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/appliance/MiTv-4A-65.png -------------------------------------------------------------------------------- /public/imgs/appliance/MiTv-4C-55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/appliance/MiTv-4C-55.png -------------------------------------------------------------------------------- /public/imgs/appliance/MiTv-4X-43.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/appliance/MiTv-4X-43.png -------------------------------------------------------------------------------- /public/imgs/appliance/MiTv-ArtTv-65.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/appliance/MiTv-ArtTv-65.png -------------------------------------------------------------------------------- /public/imgs/appliance/MiTv-E55A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/appliance/MiTv-E55A.png -------------------------------------------------------------------------------- /public/imgs/appliance/MiTv-E65A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/appliance/MiTv-E65A.png -------------------------------------------------------------------------------- /public/imgs/appliance/Washer-Pro-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/appliance/Washer-Pro-10.png -------------------------------------------------------------------------------- /public/imgs/appliance/appliance-promo1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/appliance/appliance-promo1.png -------------------------------------------------------------------------------- /public/imgs/appliance/appliance-promo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/appliance/appliance-promo2.png -------------------------------------------------------------------------------- /public/imgs/cms_1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/cms_1.jpg -------------------------------------------------------------------------------- /public/imgs/cms_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/cms_2.jpg -------------------------------------------------------------------------------- /public/imgs/cms_3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/cms_3.jpg -------------------------------------------------------------------------------- /public/imgs/cms_4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/cms_4.jpg -------------------------------------------------------------------------------- /public/imgs/phone/Mi-CC9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/Mi-CC9.png -------------------------------------------------------------------------------- /public/imgs/phone/Redmi-7A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/Redmi-7A.png -------------------------------------------------------------------------------- /public/imgs/phone/Redmi-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/Redmi-8.png -------------------------------------------------------------------------------- /public/imgs/phone/Redmi-8A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/Redmi-8A.png -------------------------------------------------------------------------------- /public/imgs/phone/Redmi-Note8-pro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/Redmi-Note8-pro.png -------------------------------------------------------------------------------- /public/imgs/phone/Redmi-Note8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/Redmi-Note8.png -------------------------------------------------------------------------------- /public/imgs/phone/Redmi-k30-5G.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/Redmi-k30-5G.png -------------------------------------------------------------------------------- /public/imgs/phone/Redmi-k30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/Redmi-k30.png -------------------------------------------------------------------------------- /public/imgs/phone/phone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/phone.png -------------------------------------------------------------------------------- /public/imgs/phone/picture/AirCondition-F3W1-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/AirCondition-F3W1-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/AirCondition-V1C1-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/AirCondition-V1C1-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MI CC9 Pro-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MI CC9 Pro-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MI CC9 Pro-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MI CC9 Pro-2.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MI CC9 Pro-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MI CC9 Pro-3.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MI CC9 Pro-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MI CC9 Pro-4.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MI CC9 Pro-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MI CC9 Pro-5.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MI CC9 Pro-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MI CC9 Pro-6.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MiTv-4A 65-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MiTv-4A 65-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MiTv-4A-32-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MiTv-4A-32-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MiTv-4A-32-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MiTv-4A-32-2.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MiTv-4A-32-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MiTv-4A-32-3.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MiTv-4A-32-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MiTv-4A-32-4.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MiTv-4C 55-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MiTv-4C 55-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MiTv-4C 55-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MiTv-4C 55-2.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MiTv-4C 55-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MiTv-4C 55-3.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MiTv-4X 43-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MiTv-4X 43-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MiTv-4X 43-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MiTv-4X 43-2.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MiTv-4X 43-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MiTv-4X 43-3.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MiTv-ArtTv-65-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MiTv-ArtTv-65-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MiTv-E55A-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MiTv-E55A-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MiTv-E55A-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MiTv-E55A-2.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MiTv-E55A-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MiTv-E55A-3.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MiTv-E55A-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MiTv-E55A-4.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MiTv-E65A-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MiTv-E65A-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MiTv-E65A-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MiTv-E65A-2.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MiTv-E65A-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MiTv-E65A-3.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/MiTv-E65A-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/MiTv-E65A-4.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi 7A-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi 7A-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi 7A-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi 7A-2.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi 7A-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi 7A-3.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi 7A-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi 7A-4.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi 7A-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi 7A-5.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi 8-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi 8-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi 8-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi 8-2.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi 8-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi 8-3.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi 8-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi 8-4.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi 8-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi 8-5.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi 8A-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi 8A-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi K30 5G-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi K30 5G-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi K30 5G-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi K30 5G-2.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi K30 5G-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi K30 5G-3.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi K30 5G-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi K30 5G-4.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi K30 5G-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi K30 5G-5.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi Note8 Pro-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi Note8 Pro-1.png -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi Note8 Pro-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi Note8 Pro-2.png -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi Note8 Pro-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi Note8 Pro-3.png -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi Note8 Pro-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi Note8 Pro-4.png -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi Note8 Pro-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi Note8 Pro-5.png -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi Note8-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi Note8-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi Note8-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi Note8-2.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi Note8-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi Note8-3.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi Note8-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi Note8-4.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi Note8-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi Note8-5.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi-k30-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi-k30-1.png -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi-k30-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi-k30-2.png -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi-k30-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi-k30-3.png -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi-k30-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi-k30-4.png -------------------------------------------------------------------------------- /public/imgs/phone/picture/Redmi-k30-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Redmi-k30-5.png -------------------------------------------------------------------------------- /public/imgs/phone/picture/Washer-Pro-10-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Washer-Pro-10-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Washer-Pro-10-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Washer-Pro-10-2.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Washer-Pro-10-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Washer-Pro-10-3.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/Washer-Pro-10-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/Washer-Pro-10-4.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-10000mAh-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-10000mAh-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-10000mAh-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-10000mAh-2.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-10000mAh-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-10000mAh-3.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-10000mAh-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-10000mAh-4.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-10000mAh-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-10000mAh-5.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-18w-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-18w-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-18w-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-18w-2.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-18w-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-18w-3.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-30w-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-30w-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-30w-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-30w-2.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-30w-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-30w-3.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-30w-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-30w-4.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-36w-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-36w-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-36w-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-36w-2.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-36w-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-36w-3.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-36w-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-36w-4.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-36w-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-36w-5.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-60w-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-60w-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-60w-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-60w-2.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-60w-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-60w-3.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-60w-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-60w-4.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-car-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-car-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-car-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-car-2.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-car-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-car-3.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-car-37w-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-car-37w-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-car-37w-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-car-37w-2.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-car-37w-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-car-37w-3.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-car-37w-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-car-37w-4.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-car-37w-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-car-37w-5.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-car-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-car-4.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-car-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-car-5.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-car-6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-car-6.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-tio-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-tio-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-tio-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-tio-2.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-tio-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-tio-3.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-tio-4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-tio-4.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/charger-tio-5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/charger-tio-5.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/protectingMen-Mi-CC9-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/protectingMen-Mi-CC9-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/protectingMen-Mi-CC9e-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/protectingMen-Mi-CC9e-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/protectingShell-Mi-9-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/protectingShell-Mi-9-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/protectingShell-Mi-9-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/protectingShell-Mi-9-2.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/protectingShell-Mi-9-red-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/protectingShell-Mi-9-red-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/protectingShell-Mi-9SE-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/protectingShell-Mi-9SE-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/protectingShell-Mi-CC9Pro-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/protectingShell-Mi-CC9Pro-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/protectingShell-Mix-3-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/protectingShell-Mix-3-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/protectingShell-RedMi-K20&pro-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/protectingShell-RedMi-K20&pro-1.jpg -------------------------------------------------------------------------------- /public/imgs/phone/picture/protectingShell-RedMi-K20-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hai-27/store-server/104aad3469376f9c5b73f90fe6e27708c6a279b5/public/imgs/phone/picture/protectingShell-RedMi-K20-1.jpg -------------------------------------------------------------------------------- /sql/product.sql: -------------------------------------------------------------------------------- 1 | SET FOREIGN_KEY_CHECKS = 0; 2 | 3 | DROP TABLE IF EXISTS `product`; 4 | CREATE TABLE `product` ( 5 | `product_id` int(11) NOT NULL AUTO_INCREMENT, 6 | `product_name` char(100) NOT NULL, 7 | `category_id` int(11) NOT NULL, 8 | `product_title` char(30) NOT NULL, 9 | `product_intro` text NOT NULL, 10 | `product_picture` char(200) DEFAULT NULL, 11 | `product_price` double NOT NULL, 12 | `product_selling_price` double NOT NULL, 13 | `product_num` int(11) NOT NULL, 14 | `product_sales` int(11) NOT NULL, 15 | PRIMARY KEY (`product_id`), 16 | KEY `FK_product_category` (`category_id`), 17 | CONSTRAINT `FK_product_category` FOREIGN KEY (`category_id`) REFERENCES `category` (`category_id`) 18 | ) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8; 19 | 20 | insert into `product`(`product_id`,`product_name`,`category_id`,`product_title`,`product_intro`,`product_picture`,`product_price`,`product_selling_price`,`product_num`,`product_sales`) values 21 | (1,'Redmi K30',1,'120Hz流速屏,全速热爱','120Hz高帧率流速屏/ 索尼6400万前后六摄 / 6.67\'小孔径全面屏 / 最高可选8GB+256GB大存储 / 高通骁龙730G处理器 / 3D四曲面玻璃机身 / 4500mAh+27W快充 / 多功能NFC','public/imgs/phone/Redmi-k30.png',2000,1599,10,0), 22 | (2,'Redmi K30 5G',1,'双模5G,120Hz流速屏','双模5G / 三路并发 / 高通骁龙765G / 7nm 5G低功耗处理器 / 120Hz高帧率流速屏 / 6.67\'小孔径全面屏 / 索尼6400万前后六摄 / 最高可选8GB+256GB大存储 / 4500mAh+30W快充 / 3D四曲面玻璃机身 / 多功能NFC','public/imgs/phone/Redmi-k30-5G.png',2599,2599,10,0), 23 | (3,'小米CC9 Pro',1,'1亿像素,五摄四闪','1亿像素主摄 / 全场景五摄像头 / 四闪光灯 / 3200万自拍 / 10 倍混合光学变焦,50倍数字变焦 / 5260mAh ⼤电量 / 标配 30W疾速快充 / ⼩米⾸款超薄屏下指纹 / 德国莱茵低蓝光认证 / 多功能NFC / 红外万能遥控 / 1216超线性扬声器','public/imgs/phone/Mi-CC9.png',2799,2599,20,0), 24 | (4,'Redmi 8',1,'5000mAh超长续航','5000mAh超长续航 / 高通骁龙439八核处理器 / 4GB+64GB','public/imgs/phone/Redmi-8.png',799,699,20,0), 25 | (5,'Redmi 8A',1,'5000mAh超长续航','5000mAh超长续航 / 高通骁龙439八核处理器 / 4GB+64GB / 1200万AI后置相机','public/imgs/phone/Redmi-8A.png',599,699,20,0), 26 | (6,'Redmi Note8 Pro',1,'6400万全场景四摄','6400万四摄小金刚拍照新旗舰超强解析力,超震撼','public/imgs/phone/Redmi-Note8-pro.png',1399,1199,20,0), 27 | (7,'Redmi Note8',1,'千元4800万四摄','千元4800万四摄 | 高通骁龙665 | 小金刚品质保证','public/imgs/phone/Redmi-Note8.png',999,999,20,0), 28 | (8,'Redmi 7A',1,'小巧大电量 持久流畅','小巧大电量,持久又流畅骁龙8核高性能处理器 | 4000mAh超长续航 | AI人脸解锁 | 整机防泼溅','public/imgs/phone/Redmi-7A.png',599,539,20,0), 29 | (9,'小米电视4A 32英寸',2,'人工智能系统,高清液晶屏','小米电视4A 32英寸 | 64位四核处理器 | 1GB+4GB大内存 | 人工智能系统','public/imgs/appliance/MiTv-4A-32.png',799,799,10,0), 30 | (10,'小米全面屏电视E55A',2,'全面屏设计,人工智能语音','全面屏设计 | 内置小爱同学 | 4K + HDR | 杜比DTS | PatchWall | 海量内容 | 2GB + 8GB大存储 | 64位四核处理器','public/imgs/appliance/MiTv-E55A.png',2099,1899,10,0), 31 | (11,'小米全面屏电视E65A',2,'全面屏设计,人工智能语音','人工智能语音系统 | 海量影视内容 | 4K 超高清屏 | 杜比音效 | 64位四核处理器 | 2GB + 8GB大存储','public/imgs/appliance/MiTv-E65A.png',3999,2799,10,0), 32 | (12,'小米电视4X 43英寸',2,'FHD全高清屏,人工智能语音','人工智能语音系统 | FHD全高清屏 | 64位四核处理器 | 海量片源 | 1GB+8GB大内存 | 钢琴烤漆','public/imgs/appliance/MiTv-4X-43.png',1499,1299,10,0), 33 | (13,'小米电视4C 55英寸',2,'4K HDR,人工智能系统','人工智能 | 大内存 | 杜比音效 | 超窄边 | 4K HDR | 海量片源 | 纤薄机身| 钢琴烤漆','public/imgs/appliance/MiTv-4C-55.png',1999,1799,10,0), 34 | (14,'小米电视4A 65英寸',2,'4K HDR,人工智能系统','人工智能 | 大内存 | 杜比音效 | 超窄边 | 4K HDR | 海量片源 | 纤薄机身| 钢琴烤漆','public/imgs/appliance/MiTv-4A-65.png',2999,2799,10,0), 35 | (15,'小米壁画电视 65英寸',2,'壁画外观,全面屏,远场语音','纯平背板 | 通体13.9mm | 远场语音 | 4K+HDR | 杜比+DTS | 画框模式 | 内置小爱同学 | PatchWall | SoundBar+低音炮 | 四核处理器+大存储','public/imgs/appliance/MiTv-ArtTv-65.png',6999,6999,10,0), 36 | (16,'米家互联网空调C1(一级能效)',3,'变频节能省电,自清洁','一级能效 | 1.5匹 | 全直流变频 | 高效制冷/热 | 静音设计 | 自清洁 | 全屋互联','public/imgs/appliance/AirCondition-V1C1.png',2699,2599,20,10), 37 | (17,'米家空调',3,'出众静音,快速制冷热','大1匹 | 三级能效 | 静音 | 快速制冷热 | 广角送风 | 除湿功能 | 高密度过滤网 | 典雅外观','public/imgs/appliance/AirCondition-F3W1.png',1799,1699,20,8), 38 | (18,'米家互联网洗烘一体机 Pro 10kg',4,'智能洗烘,省心省力','国标双A+级洗烘能力 / 22种洗烘模式 / 智能投放洗涤剂 / 支持小爱同学语音遥控 / 支持OTA在线智能升级 / 智能空气洗 / 除菌率达99.9%+','public/imgs/appliance/Washer-Pro-10.png',2999,2999,20,7), 39 | (19,'Redmi K20/ K20 Pro 怪力魔王保护壳',5,'怪力魔王专属定制','优选PC材料,强韧张力,经久耐用 / 精选开孔,全面贴合机身 / 手感轻薄细腻,舒适无负担 / 三款颜色可选,彰显个性,与众不同','public/imgs/accessory/protectingShell-RedMi-K20&pro.png',39,39,20,10), 40 | (20,'小米9 ARE U OK保护壳',5,'一个与众不同的保护壳','彰显独特个性 / 轻薄无负担 / 优选PC材料 / 贴合机身 / 潮流五色','public/imgs/accessory/protectingShell-Mi-9.png',49,39,20,10), 41 | (21,'小米CC9&小米CC9美图定制版 标准高透贴膜',6,'高清透亮,耐磨性强','耐磨性强,防护更出众 / 疏油疏水,有效抗水抗脏污 / 高清透亮,保留了原生屏幕的亮丽颜色和清晰度 / 操作灵敏,智能吸附 / 进口高端PET材质,裸机般手感','public/imgs/accessory/protectingMen-Mi-CC9.png',19,19,20,9), 42 | (22,'小米CC9e 标准高透贴膜',6,'高清透亮,耐磨性强','耐磨性强,防护更出众 / 疏油疏水,有效抗水抗脏污 / 高清透亮,保留了原生屏幕的亮丽颜色和清晰度 / 操作灵敏,智能吸附 / 进口高端PET材质,裸机般手感','public/imgs/accessory/protectingMen-Mi-CC9e.png',19,19,20,9), 43 | (23,'小米USB充电器30W快充版(1A1C)',7,'多一种接口,多一种选择','双口输出 / 30W 输出 / 可折叠插脚 / 小巧便携','public/imgs/accessory/charger-30w.png',59,59,20,8), 44 | (24,'小米USB充电器快充版(18W)',7,'安卓、苹果设备均可使用','支持QC3.0设备充电 / 支持iOS设备充电/ 美观耐用','public/imgs/accessory/charger-18w.png',29,29,20,8), 45 | (25,'小米USB充电器60W快充版(6口)',7,'6口输出,USB-C输出接口','6口输出 / USB-C输出接口 / 支持QC3.0快充协议 / 总输出功率60W','public/imgs/accessory/charger-60w.png',129,129,20,0), 46 | (26,'小米USB充电器36W快充版(2口)',7,'6多重安全保护,小巧便携','双USB输出接口 / 支持QC3.0快充协议 / 多重安全保护 / 小巧便携','public/imgs/accessory/charger-36w.png',59,59,20,0), 47 | (27,'小米车载充电器快充版',7,'让爱车成为移动充电站','QC3.0 双口输出 / 智能温度控制 / 5重安全保护 / 兼容iOS&Android设备','public/imgs/accessory/charger-car.png',69,69,20,0), 48 | (28,'小米车载充电器快充版(37W)',7,'双口快充,车载充电更安全','单口27W 快充 / 双口输出 / 多重安全保护','public/imgs/accessory/charger-car-37w.png',49,49,20,0), 49 | (29,'小米二合一移动电源(充电器)',7,'一个设备多种用途','5000mAh充沛电量 / 多协议快充 / USB 口输出','public/imgs/accessory/charger-tio.png',99,99,20,0), 50 | (30,'小米无线充电宝青春版10000mAh',8,'能量满满,无线有线都能充','10000mAh大容量 / 支持边充边放 / 有线无线都能充 / 双向快充','public/imgs/accessory/charger-10000mAh.png',129,129,20,8), 51 | (31,'小米CC9 Pro/尊享版 撞色飘带保护壳',5,'全面贴合,无感更舒适','优选环保PC材质,强韧张力,全面贴合,无感更舒适','public/imgs/accessory/protectingShell-Mi-CC9Pro.png',69,69,20,0), 52 | (32,'Redmi K20系列 幻境之心保护壳',5,'柔软坚韧,全面贴合','优质环保材质,柔软坚韧 / 全面贴合,有效抵抗灰尘 / 鲜亮三种颜色可选,为爱机随时换装','public/imgs/accessory/protectingShell-RedMi-K20.png',39,39,20,0), 53 | (33,'小米9 SE 街头风保护壳黑色',5,'个性时尚,细节出众','个性时尚 / 细节出众 / 纤薄轻巧 / 多彩时尚','public/imgs/accessory/protectingShell-Mi-9SE.png',49,49,20,0), 54 | (34,'小米9 街头风保护壳 红色',5,'个性时尚,细节出众','时尚多彩 / 细节出众 / 纤薄轻巧 / 是腕带也是支架','public/imgs/accessory/protectingShell-Mi-9-red.png',49,49,20,0), 55 | (35,'小米MIX 3 极简保护壳蓝色',5,'时尚简约设计,手感细腻顺滑','时尚简约设计,手感细腻顺滑 / 优质环保PC原材料,强韧张力,经久耐用 / 超薄 0.8MM厚度','public/imgs/accessory/protectingShell-Mix-3.png',49,12.9,20,0); 56 | SET FOREIGN_KEY_CHECKS = 1; 57 | 58 | -------------------------------------------------------------------------------- /sql/product_picture.sql: -------------------------------------------------------------------------------- 1 | SET FOREIGN_KEY_CHECKS = 0; 2 | 3 | DROP TABLE IF EXISTS `product_picture`; 4 | CREATE TABLE `product_picture` ( 5 | `id` int(11) NOT NULL AUTO_INCREMENT, 6 | `product_id` int(11) NOT NULL, 7 | `product_picture` char(200) DEFAULT NULL, 8 | `intro` text, 9 | PRIMARY KEY (`id`), 10 | KEY `FK_product_id` (`product_id`), 11 | CONSTRAINT `FK_product_id` FOREIGN KEY (`product_id`) REFERENCES `product` (`product_id`) 12 | ) ENGINE=InnoDB AUTO_INCREMENT=111 DEFAULT CHARSET=utf8; 13 | 14 | insert into `product_picture`(`id`,`product_id`,`product_picture`,`intro`) values 15 | (1,1,'public/imgs/phone/picture/Redmi-k30-1.png',null), 16 | (2,1,'public/imgs/phone/picture/Redmi-k30-2.png',null), 17 | (3,1,'public/imgs/phone/picture/Redmi-k30-3.png',null), 18 | (4,1,'public/imgs/phone/picture/Redmi-k30-4.png',null), 19 | (5,1,'public/imgs/phone/picture/Redmi-k30-5.png',null), 20 | (6,2,'public/imgs/phone/picture/Redmi K30 5G-1.jpg',null), 21 | (7,2,'public/imgs/phone/picture/Redmi K30 5G-2.jpg',null), 22 | (8,2,'public/imgs/phone/picture/Redmi K30 5G-3.jpg',null), 23 | (9,2,'public/imgs/phone/picture/Redmi K30 5G-4.jpg',null), 24 | (10,2,'public/imgs/phone/picture/Redmi K30 5G-5.jpg',null), 25 | (11,3,'public/imgs/phone/picture/MI CC9 Pro-1.jpg',null), 26 | (12,3,'public/imgs/phone/picture/MI CC9 Pro-2.jpg',null), 27 | (13,3,'public/imgs/phone/picture/MI CC9 Pro-3.jpg',null), 28 | (14,3,'public/imgs/phone/picture/MI CC9 Pro-4.jpg',null), 29 | (15,3,'public/imgs/phone/picture/MI CC9 Pro-5.jpg',null), 30 | (16,3,'public/imgs/phone/picture/MI CC9 Pro-6.jpg',null), 31 | (17,4,'public/imgs/phone/picture/Redmi 8-1.jpg',null), 32 | (18,4,'public/imgs/phone/picture/Redmi 8-2.jpg',null), 33 | (19,4,'public/imgs/phone/picture/Redmi 8-3.jpg',null), 34 | (20,4,'public/imgs/phone/picture/Redmi 8-4.jpg',null), 35 | (21,4,'public/imgs/phone/picture/Redmi 8-5.jpg',null), 36 | (22,5,'public/imgs/phone/picture/Redmi 8A-1.jpg',null), 37 | (23,6,'public/imgs/phone/picture/Redmi Note8 Pro-1.png',null), 38 | (24,6,'public/imgs/phone/picture/Redmi Note8 Pro-2.png',null), 39 | (25,6,'public/imgs/phone/picture/Redmi Note8 Pro-3.png',null), 40 | (26,6,'public/imgs/phone/picture/Redmi Note8 Pro-4.png',null), 41 | (27,6,'public/imgs/phone/picture/Redmi Note8 Pro-5.png',null), 42 | (28,7,'public/imgs/phone/picture/Redmi Note8-1.jpg',null), 43 | (29,7,'public/imgs/phone/picture/Redmi Note8-2.jpg',null), 44 | (30,7,'public/imgs/phone/picture/Redmi Note8-3.jpg',null), 45 | (31,7,'public/imgs/phone/picture/Redmi Note8-4.jpg',null), 46 | (32,7,'public/imgs/phone/picture/Redmi Note8-5.jpg',null), 47 | (33,8,'public/imgs/phone/picture/Redmi 7A-1.jpg',null), 48 | (34,8,'public/imgs/phone/picture/Redmi 7A-2.jpg',null), 49 | (35,8,'public/imgs/phone/picture/Redmi 7A-3.jpg',null), 50 | (36,8,'public/imgs/phone/picture/Redmi 7A-4.jpg',null), 51 | (37,8,'public/imgs/phone/picture/Redmi 7A-5.jpg',null), 52 | (38,9,'public/imgs/phone/picture/MiTv-4A-32-1.jpg',null), 53 | (39,9,'public/imgs/phone/picture/MiTv-4A-32-2.jpg',null), 54 | (40,9,'public/imgs/phone/picture/MiTv-4A-32-3.jpg',null), 55 | (41,9,'public/imgs/phone/picture/MiTv-4A-32-4.jpg',null), 56 | (42,10,'public/imgs/phone/picture/MiTv-E55A-1.jpg',null), 57 | (43,10,'public/imgs/phone/picture/MiTv-E55A-2.jpg',null), 58 | (44,10,'public/imgs/phone/picture/MiTv-E55A-3.jpg',null), 59 | (45,10,'public/imgs/phone/picture/MiTv-E55A-4.jpg',null), 60 | (46,11,'public/imgs/phone/picture/MiTv-E65A-1.jpg',null), 61 | (47,11,'public/imgs/phone/picture/MiTv-E65A-2.jpg',null), 62 | (48,11,'public/imgs/phone/picture/MiTv-E65A-3.jpg',null), 63 | (49,11,'public/imgs/phone/picture/MiTv-E65A-4.jpg',null), 64 | (50,12,'public/imgs/phone/picture/MiTv-4X 43-1.jpg',null), 65 | (51,12,'public/imgs/phone/picture/MiTv-4X 43-2.jpg',null), 66 | (52,12,'public/imgs/phone/picture/MiTv-4X 43-3.jpg',null), 67 | (53,13,'public/imgs/phone/picture/MiTv-4C 55-1.jpg',null), 68 | (54,13,'public/imgs/phone/picture/MiTv-4C 55-2.jpg',null), 69 | (55,13,'public/imgs/phone/picture/MiTv-4C 55-3.jpg',null), 70 | (56,14,'public/imgs/phone/picture/MiTv-4A 65-1.jpg',null), 71 | (57,15,'public/imgs/phone/picture/MiTv-ArtTv-65-1.jpg',null), 72 | (58,16,'public/imgs/phone/picture/AirCondition-V1C1-1.jpg',null), 73 | (59,17,'public/imgs/phone/picture/AirCondition-F3W1-1.jpg',null), 74 | (60,18,'public/imgs/phone/picture/Washer-Pro-10-1.jpg',null), 75 | (61,18,'public/imgs/phone/picture/Washer-Pro-10-2.jpg',null), 76 | (62,18,'public/imgs/phone/picture/Washer-Pro-10-3.jpg',null), 77 | (63,18,'public/imgs/phone/picture/Washer-Pro-10-4.jpg',null), 78 | (64,19,'public/imgs/phone/picture/protectingShell-RedMi-K20&pro-1.jpg',null), 79 | (65,20,'public/imgs/phone/picture/protectingShell-Mi-9-1.jpg',null), 80 | (66,20,'public/imgs/phone/picture/protectingShell-Mi-9-2.jpg',null), 81 | (67,21,'public/imgs/phone/picture/protectingMen-Mi-CC9-1.jpg',null), 82 | (68,22,'public/imgs/phone/picture/protectingMen-Mi-CC9e-1.jpg',null), 83 | (69,23,'public/imgs/phone/picture/charger-30w-1.jpg',null), 84 | (70,23,'public/imgs/phone/picture/charger-30w-2.jpg',null), 85 | (71,23,'public/imgs/phone/picture/charger-30w-3.jpg',null), 86 | (72,23,'public/imgs/phone/picture/charger-30w-4.jpg',null), 87 | (73,24,'public/imgs/phone/picture/charger-18w-1.jpg',null), 88 | (74,24,'public/imgs/phone/picture/charger-18w-2.jpg',null), 89 | (75,24,'public/imgs/phone/picture/charger-18w-3.jpg',null), 90 | (76,25,'public/imgs/phone/picture/charger-60w-1.jpg',null), 91 | (77,25,'public/imgs/phone/picture/charger-60w-2.jpg',null), 92 | (78,25,'public/imgs/phone/picture/charger-60w-3.jpg',null), 93 | (79,25,'public/imgs/phone/picture/charger-60w-4.jpg',null), 94 | (80,26,'public/imgs/phone/picture/charger-36w-1.jpg',null), 95 | (81,26,'public/imgs/phone/picture/charger-36w-2.jpg',null), 96 | (82,26,'public/imgs/phone/picture/charger-36w-3.jpg',null), 97 | (83,26,'public/imgs/phone/picture/charger-36w-4.jpg',null), 98 | (84,26,'public/imgs/phone/picture/charger-36w-5.jpg',null), 99 | (85,27,'public/imgs/phone/picture/charger-car-1.jpg',null), 100 | (86,27,'public/imgs/phone/picture/charger-car-2.jpg',null), 101 | (87,27,'public/imgs/phone/picture/charger-car-3.jpg',null), 102 | (88,27,'public/imgs/phone/picture/charger-car-4.jpg',null), 103 | (89,27,'public/imgs/phone/picture/charger-car-5.jpg',null), 104 | (90,27,'public/imgs/phone/picture/charger-car-6.jpg',null), 105 | (91,28,'public/imgs/phone/picture/charger-car-37w-1.jpg',null), 106 | (92,28,'public/imgs/phone/picture/charger-car-37w-2.jpg',null), 107 | (93,28,'public/imgs/phone/picture/charger-car-37w-3.jpg',null), 108 | (94,28,'public/imgs/phone/picture/charger-car-37w-4.jpg',null), 109 | (95,28,'public/imgs/phone/picture/charger-car-37w-5.jpg',null), 110 | (96,29,'public/imgs/phone/picture/charger-tio-1.jpg',null), 111 | (97,29,'public/imgs/phone/picture/charger-tio-2.jpg',null), 112 | (98,29,'public/imgs/phone/picture/charger-tio-3.jpg',null), 113 | (99,29,'public/imgs/phone/picture/charger-tio-4.jpg',null), 114 | (100,29,'public/imgs/phone/picture/charger-tio-5.jpg',null), 115 | (101,30,'public/imgs/phone/picture/charger-10000mAh-1.jpg',null), 116 | (102,30,'public/imgs/phone/picture/charger-10000mAh-2.jpg',null), 117 | (103,30,'public/imgs/phone/picture/charger-10000mAh-3.jpg',null), 118 | (104,30,'public/imgs/phone/picture/charger-10000mAh-4.jpg',null), 119 | (105,30,'public/imgs/phone/picture/charger-10000mAh-5.jpg',null), 120 | (106,31,'public/imgs/phone/picture/protectingShell-Mi-CC9Pro-1.jpg',null), 121 | (107,32,'public/imgs/phone/picture/protectingShell-RedMi-K20-1.jpg',null), 122 | (108,33,'public/imgs/phone/picture/protectingShell-Mi-9SE-1.jpg',null), 123 | (109,34,'public/imgs/phone/picture/protectingShell-Mi-9-red-1.jpg',null), 124 | (110,35,'public/imgs/phone/picture/protectingShell-Mix-3-1.jpg',null); 125 | SET FOREIGN_KEY_CHECKS = 1; 126 | 127 | -------------------------------------------------------------------------------- /storeDB.sql: -------------------------------------------------------------------------------- 1 | /* 2 | * @Description: 建库建表语句 3 | * @Author: hai-27 4 | * @Date: 2020-02-07 16:51:58 5 | * @LastEditors: hai-27 6 | * @LastEditTime: 2020-03-27 15:36:01 7 | */ 8 | create database storeDB; 9 | use storeDB; 10 | create table users( 11 | user_id int primary key auto_increment, 12 | userName char (40) not null unique, 13 | password char (40) not null, 14 | userPhoneNumber char(11) null 15 | ); 16 | -- ALTER TABLE users MODIFY COLUMN userName char (40) not null unique; 17 | -- ALTER TABLE users MODIFY COLUMN password char (40) not null; 18 | -- insert into users 19 | -- values(null, 'admin', '123456', '100861001010000'); 20 | create table carousel( 21 | carousel_id int primary key auto_increment, 22 | imgPath char (50) not null, 23 | describes char (50) not null 24 | ); 25 | -- insert into carousel 26 | -- values(null, 'public/imgs/cms_1.jpg', '123456'); 27 | -- insert into carousel 28 | -- values(null, 'public/imgs/cms_2.jpg', '123456'); 29 | -- insert into carousel 30 | -- values(null, 'public/imgs/cms_3.jpg', '123456'); 31 | -- insert into carousel 32 | -- values(null, 'public/imgs/cms_4.jpg', '123456'); 33 | create table category( 34 | category_id int primary key auto_increment, 35 | category_name char(20) not null 36 | ); 37 | create table product( 38 | product_id int primary key auto_increment, 39 | product_name char (100) not null, 40 | category_id int not null, 41 | product_title char (30) not null, 42 | product_intro text not null, 43 | product_picture char (200), 44 | product_price double not null, 45 | product_selling_price double not null, 46 | product_num int not null, 47 | product_sales int not null, 48 | constraint FK_product_category foreign key (category_id) references category (category_id) 49 | ); 50 | create table product_picture( 51 | id int primary key auto_increment, 52 | product_id int not null, 53 | product_picture char (200), 54 | intro text null, 55 | constraint FK_product_id foreign key (product_id) references product (product_id) 56 | ); 57 | create table shoppingCart( 58 | id int primary key auto_increment, 59 | user_id int not null, 60 | product_id int not null, 61 | num int not null, 62 | constraint FK_user_id foreign key (user_id) references users (user_id), 63 | constraint FK_shoppingCart_id foreign key (product_id) references product (product_id) 64 | ); 65 | create table orders( 66 | id int primary key auto_increment, 67 | order_id bigint not null, 68 | user_id int not null, 69 | product_id int not null, 70 | product_num int not null, 71 | product_price double not null, 72 | order_time bigint not null, 73 | constraint FK_order_user_id foreign key (user_id) references users (user_id), 74 | constraint FK_order_id foreign key (product_id) references product (product_id) 75 | ); 76 | create table collect( 77 | id int primary key auto_increment, 78 | user_id int not null, 79 | product_id int not null, 80 | collect_time bigint not null, 81 | constraint FK_collect_user_id foreign key (user_id) references users (user_id), 82 | constraint FK_collect_id foreign key (product_id) references product (product_id) 83 | ); 84 | --------------------------------------------------------------------------------