├── index.js
├── 2-6. 联表查询
├── index.js
├── .gitignore
├── distinct.sql
├── readme.md
└── join.sql
├── 1-10. https协议
├── index.js
├── public
│ ├── script
│ │ └── a.js
│ ├── css
│ │ └── index.css
│ └── img
│ │ └── u=2770282747,1971577128&fm=26&gp=0.jpg
├── .gitignore
├── 演示.pptx
└── readme.md
├── 1-7. 文件流
├── abc.txt
├── .gitignore
└── readme.md
├── 2-4. 表记录的增删改
├── index.js
├── .gitignore
├── delete.sql
├── update.sql
└── readme.md
├── 2-5. 单表基本查询
├── index.js
├── .gitignore
├── limit.sql
├── order by.sql
└── readme.md
├── 2-7. 函数和分组
├── index.js
├── .gitignore
├── readme.md
├── 数学函数.sql
├── 聚合函数.sql
├── 字符串和日期函数.sql
└── 分组.sql
├── 1-6. 文件IO
├── myfiles
│ ├── 1
│ │ ├── 3.txt
│ │ └── 6.txt
│ ├── 2.txt
│ ├── sub
│ │ └── 3.txt
│ ├── 1.txt
│ ├── 1.jpeg
│ └── 1.copy.jpeg
├── .gitignore
├── readme.md
├── fs.mkdir.js
├── fs.readdir.js
└── fs.stat.js
├── 3-2. Sequelize简介
├── index.js
├── .gitignore
├── ORM原理图.jpg
└── readme.md
├── 4-13. jwt
├── routes
│ ├── api
│ │ ├── book.js
│ │ └── class.js
│ └── errorMiddleware.js
├── index.js
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── .gitignore
├── public
│ └── css
│ │ └── index.css
├── init.js
├── client
│ └── readme.md
├── nodemon.json
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── .vscode
│ └── launch.json
├── 4-8. 断点调试
├── routes
│ ├── api
│ │ ├── book.js
│ │ └── class.js
│ └── errorMiddleware.js
├── index.js
├── public
│ ├── js
│ │ └── index.js
│ └── css
│ │ └── index.css
├── .gitignore
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── 三层架构.jpg
├── init.js
├── client
│ └── readme.md
├── nodemon.json
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── .vscode
│ └── launch.json
├── 1-2. 全局对象
├── .gitignore
├── readme.md
├── src
│ └── index.js
└── index.js
├── 4-10. 跨域之CORS
├── routes
│ ├── api
│ │ ├── book.js
│ │ └── class.js
│ └── errorMiddleware.js
├── index.js
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── .gitignore
├── public
│ ├── css
│ │ └── index.css
│ └── index.html
├── 三层架构.jpg
├── init.js
├── client
│ └── readme.md
├── nodemon.json
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── .vscode
│ └── launch.json
├── 4-11. CORS中间件
├── routes
│ ├── api
│ │ ├── book.js
│ │ └── class.js
│ └── errorMiddleware.js
├── index.js
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── .gitignore
├── public
│ ├── css
│ │ └── index.css
│ └── index.html
├── 三层架构.jpg
├── init.js
├── client
│ └── readme.md
├── nodemon.json
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── .vscode
│ └── launch.json
├── 4-12. session
├── routes
│ ├── api
│ │ ├── book.js
│ │ └── class.js
│ └── errorMiddleware.js
├── index.js
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── .gitignore
├── public
│ └── css
│ │ └── index.css
├── 三层架构.jpg
├── init.js
├── session原理示意图.jpg
├── client
│ └── readme.md
├── nodemon.json
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── .vscode
│ └── launch.json
├── 4-25. 场景 - 客户端缓存
├── public
│ ├── 1.asaf.js
│ ├── 1.asfdasdf.css
│ ├── img
│ │ ├── logo.jpg
│ │ └── water.jpg
│ └── index.html
├── routes
│ ├── api
│ │ ├── book.js
│ │ ├── class.js
│ │ └── download.js
│ ├── apiLoggerMid.js
│ └── proxyMid.js
├── index.js
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── init.js
├── .gitignore
├── nodemon.json
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── .vscode
│ └── launch.json
├── 4-5. express路由
├── routes
│ ├── api
│ │ ├── book.js
│ │ ├── admin.js
│ │ └── class.js
│ └── errorMiddleware.js
├── index.js
├── public
│ ├── js
│ │ └── index.js
│ ├── css
│ │ └── index.css
│ └── index.html
├── .gitignore
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── 三层架构.jpg
├── init.js
├── client
│ └── readme.md
├── readme.md
├── nodemon.json
├── mock
│ └── mockClass.js
└── util
│ └── propertyHelper.js
├── 4-7. 实现登陆和认证
├── routes
│ ├── api
│ │ ├── book.js
│ │ └── class.js
│ └── errorMiddleware.js
├── index.js
├── public
│ ├── js
│ │ └── index.js
│ └── css
│ │ └── index.css
├── .gitignore
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── 三层架构.jpg
├── init.js
├── client
│ └── readme.md
├── nodemon.json
├── mock
│ └── mockClass.js
└── util
│ └── propertyHelper.js
├── 4-9. 跨域之JSONP
├── routes
│ ├── api
│ │ ├── book.js
│ │ └── class.js
│ └── errorMiddleware.js
├── index.js
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── .gitignore
├── public
│ ├── css
│ │ └── index.css
│ └── index.html
├── 三层架构.jpg
├── init.js
├── client
│ └── readme.md
├── nodemon.json
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── .vscode
│ └── launch.json
├── 5-4. CSRF攻击和防御
├── routes
│ ├── api
│ │ ├── book.js
│ │ └── class.js
│ └── errorMiddleware.js
├── index.js
├── .gitignore
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── init.js
├── public
│ └── css
│ │ └── index.css
├── client
│ └── readme.md
├── nodemon.json
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── danger
│ └── index.html
├── 1-5. 基本内置模块
├── .gitignore
├── readme.md
└── about os.js
├── 4-14. 登录和认证-服务器开发
├── routes
│ ├── api
│ │ ├── book.js
│ │ └── class.js
│ └── errorMiddleware.js
├── index.js
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── .gitignore
├── public
│ └── css
│ │ └── index.css
├── init.js
├── client
│ └── readme.md
├── nodemon.json
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── .vscode
│ └── launch.json
├── 4-15. 登录和认证-客户端开发
├── routes
│ ├── api
│ │ ├── book.js
│ │ └── class.js
│ └── errorMiddleware.js
├── index.js
├── client
│ ├── .browserslistrc
│ ├── babel.config.js
│ ├── public
│ │ └── favicon.ico
│ ├── src
│ │ ├── assets
│ │ │ └── logo.png
│ │ ├── views
│ │ │ ├── Protect.vue
│ │ │ └── Home.vue
│ │ ├── store
│ │ │ └── index.js
│ │ └── main.js
│ ├── vue.config.js
│ └── readme.md
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── .gitignore
├── init.js
├── public
│ ├── favicon.ico
│ ├── img
│ │ └── logo.82b9c7a5.png
│ └── css
│ │ └── app.5c9713c3.css
├── nodemon.json
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── .vscode
│ └── launch.json
├── 4-16. 场景 - 日志记录
├── routes
│ ├── api
│ │ ├── book.js
│ │ └── class.js
│ ├── errorMiddleware.js
│ └── apiLoggerMid.js
├── index.js
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── .gitignore
├── init.js
├── nodemon.json
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── .vscode
│ └── launch.json
├── 4-17. 场景 - 文件上传
├── routes
│ ├── api
│ │ ├── book.js
│ │ └── class.js
│ └── apiLoggerMid.js
├── index.js
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── .gitignore
├── init.js
├── nodemon.json
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── .vscode
│ └── launch.json
├── 4-18. 场景 - 文件下载
├── routes
│ ├── api
│ │ ├── book.js
│ │ ├── class.js
│ │ └── download.js
│ └── apiLoggerMid.js
├── index.js
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── init.js
├── .gitignore
├── nodemon.json
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── .vscode
│ └── launch.json
├── 4-19. 场景 - 图片水印
├── routes
│ ├── api
│ │ ├── book.js
│ │ ├── class.js
│ │ └── download.js
│ └── apiLoggerMid.js
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── new.jpg
├── origin.jpg
├── water.jpg
├── init.js
├── public
│ └── img
│ │ └── water.jpg
├── .gitignore
├── nodemon.json
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── .vscode
│ └── launch.json
├── 4-20. 场景 - 图片防盗链
├── routes
│ ├── api
│ │ ├── book.js
│ │ ├── class.js
│ │ └── download.js
│ └── apiLoggerMid.js
├── index.js
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── init.js
├── public
│ ├── img
│ │ ├── logo.jpg
│ │ └── water.jpg
│ └── index.html
├── .gitignore
├── nodemon.json
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── .vscode
│ └── launch.json
├── 4-21. 重要场景 - 代理
├── routes
│ ├── api
│ │ ├── book.js
│ │ ├── class.js
│ │ └── download.js
│ ├── apiLoggerMid.js
│ └── proxyMid.js
├── index.js
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── 代理服务器.jpg
├── init.js
├── public
│ ├── img
│ │ ├── logo.jpg
│ │ └── water.jpg
│ └── index.html
├── .gitignore
├── nodemon.json
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── .vscode
│ └── launch.json
├── 4-22. 扩展场景 - 模版引擎
├── routes
│ ├── api
│ │ ├── book.js
│ │ ├── class.js
│ │ └── download.js
│ ├── apiLoggerMid.js
│ └── proxyMid.js
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── init.js
├── 两种渲染方式.jpg
├── public
│ ├── img
│ │ ├── logo.jpg
│ │ └── water.jpg
│ └── index.html
├── .gitignore
├── nodemon.json
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
├── test.ejs
└── .vscode
│ └── launch.json
├── 4-23. 场景 - 生成二维码
├── routes
│ ├── api
│ │ ├── book.js
│ │ ├── class.js
│ │ └── download.js
│ ├── apiLoggerMid.js
│ └── proxyMid.js
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── code.png
├── init.js
├── public
│ └── img
│ │ ├── logo.jpg
│ │ └── water.jpg
├── .gitignore
├── nodemon.json
├── index.js
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── .vscode
│ └── launch.json
├── 4-24. 场景 - 生成验证码
├── routes
│ ├── api
│ │ ├── book.js
│ │ ├── class.js
│ │ └── download.js
│ ├── apiLoggerMid.js
│ └── proxyMid.js
├── index.js
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── init.js
├── public
│ └── img
│ │ ├── logo.jpg
│ │ └── water.jpg
├── .gitignore
├── nodemon.json
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── .vscode
│ └── launch.json
├── 4-26. 场景 - 富文本框
├── routes
│ ├── api
│ │ ├── class.js
│ │ └── download.js
│ ├── apiLoggerMid.js
│ └── proxyMid.js
├── index.js
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── init.js
├── public
│ └── img
│ │ ├── logo.jpg
│ │ └── water.jpg
├── .gitignore
├── nodemon.json
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── .vscode
│ └── launch.json
├── 4-6. cookie的基本概念
├── routes
│ ├── api
│ │ ├── book.js
│ │ └── class.js
│ └── errorMiddleware.js
├── index.js
├── public
│ ├── js
│ │ └── index.js
│ └── css
│ │ └── index.css
├── .gitignore
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── 三层架构.jpg
├── init.js
├── client
│ └── readme.md
├── nodemon.json
├── mock
│ └── mockClass.js
└── util
│ └── propertyHelper.js
├── 1-3. Node的模块化细节
├── .gitignore
├── ab.js
├── a.json
├── src
│ └── index.js
├── readme.md
├── myModule.js
└── index copy.js
├── 1-4. 【扩展】Node中的ES模块
├── .gitignore
├── index.mjs
├── a.mjs
└── readme.md
├── 4-4. 常用中间件
├── index.js
├── public
│ ├── js
│ │ └── index.js
│ ├── css
│ │ └── index.css
│ └── index.html
├── .gitignore
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── 三层架构.jpg
├── 中间件示意图.jpg
├── init.js
├── client
│ └── readme.md
├── readme.md
├── nodemon.json
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── routes
│ └── errorMiddleware.js
├── 1-8. net模块
├── .gitignore
├── hsq.jpg
└── readme.md
├── 4-3. express中间件
├── index.js
├── .gitignore
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── 三层架构.jpg
├── 中间件示意图.jpg
├── init.js
├── readme.md
├── nodemon.json
├── routes
│ ├── staticMiddleware.js
│ └── errorMiddleware.js
├── mock
│ └── mockClass.js
└── util
│ └── propertyHelper.js
├── 1-9. http模块
├── public
│ ├── script
│ │ └── a.js
│ ├── css
│ │ └── index.css
│ └── img
│ │ └── u=2770282747,1971577128&fm=26&gp=0.jpg
├── .gitignore
└── readme.md
├── 3-3. 模型定义和同步
├── index.js
├── .gitignore
├── ORM原理图.jpg
├── readme.md
└── models
│ ├── db.js
│ └── sync.js
├── .gitignore
├── 1-11. https模块
├── public
│ ├── script
│ │ └── a.js
│ ├── css
│ │ └── index.css
│ └── img
│ │ └── u=2770282747,1971577128&fm=26&gp=0.jpg
├── .gitignore
├── ca-cert.srl
├── 演示.pptx
└── readme.md
├── 3-10. 数据验证
├── .gitignore
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── init.js
├── 三层架构.jpg
├── readme.md
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── index.js
├── 3-4. 模型的增删改
├── .gitignore
├── 三层架构.jpg
├── readme.md
├── models
│ ├── sync.js
│ └── db.js
└── index.js
├── 3-5. 模拟数据
├── .gitignore
├── index.js
├── 三层架构.jpg
├── readme.md
├── models
│ ├── relation.js
│ ├── sync.js
│ └── db.js
└── mock
│ └── mockClass.js
├── 3-6. 数据抓取
├── .gitignore
├── index.js
├── 三层架构.jpg
├── readme.md
├── models
│ ├── relation.js
│ ├── sync.js
│ └── db.js
└── mock
│ └── mockClass.js
├── 3-7. 数据查询
├── .gitignore
├── 三层架构.jpg
├── readme.md
├── models
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── index.js
├── index copy.js
└── mock
│ └── mockClass.js
├── 3-8. MD5加密
├── .gitignore
├── 三层架构.jpg
├── readme.md
├── models
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── index.js
└── mock
│ └── mockClass.js
├── 3-9. moment
├── .gitignore
├── 三层架构.jpg
├── 时间处理模式.jpg
├── readme.md
├── models
│ ├── relation.js
│ ├── sync.js
│ └── db.js
└── mock
│ └── mockClass.js
├── 1-12. node生命周期
├── .gitignore
├── 课件.pptx
├── readme.md
├── index copy 3.js
├── 面试题1.js
├── index copy 2.js
├── index copy.js
└── index.js
├── 3-1. mysql驱动程序
├── .gitignore
└── readme.md
├── 3-11. 访问器和虚拟字段
├── .gitignore
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── init.js
├── 三层架构.jpg
├── readme.md
├── mock
│ └── mockClass.js
└── util
│ └── propertyHelper.js
├── 5-6. NodeJS组成原理
├── index.js
├── .gitignore
├── nodemon.json
├── .vscode
│ └── launch.json
└── 原理图说明.md
├── 3-12. 日志记录
├── .gitignore
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── init.js
├── 三层架构.jpg
├── log等级.jpg
├── readme.md
├── index.js
├── mock
│ └── mockClass.js
└── util
│ └── propertyHelper.js
├── 1-13. [扩展] EventEmitter
├── .gitignore
├── readme.md
├── index.js
└── index copy 2.js
├── 4-2. nodemon
├── .gitignore
├── init.js
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── 三层架构.jpg
├── readme.md
├── nodemon.json
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── index.js
├── 4-1. express的基本使用
├── .gitignore
├── models
│ ├── init.js
│ ├── relation.js
│ ├── sync.js
│ └── db.js
├── init.js
├── log等级.jpg
├── 三层架构.jpg
├── readme.md
├── mock
│ └── mockClass.js
├── util
│ └── propertyHelper.js
└── index copy.js
├── NodeJS.xmind
├── 5-5. XSS攻击和防御
├── .gitignore
├── nodemon.json
└── .vscode
│ └── launch.json
├── 5-7. 进程和线程
├── .gitignore
├── isPrime.js
├── nodemon.json
├── index copy 2.js
├── index copy 3.js
└── .vscode
│ └── launch.json
├── 5-1. websocket原理
├── .gitignore
├── nodemon.json
└── .vscode
│ └── launch.json
├── 5-2. socket.io
├── .gitignore
├── nodemon.json
└── .vscode
│ └── launch.json
├── 5-3. [扩展]在线聊天室
├── .gitignore
├── nodemon.json
└── .vscode
│ └── launch.json
└── .vscode
└── launch.json
/index.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/2-6. 联表查询/index.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/1-10. https协议/index.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/1-7. 文件流/abc.txt:
--------------------------------------------------------------------------------
1 | 渡一abc
--------------------------------------------------------------------------------
/2-4. 表记录的增删改/index.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/2-5. 单表基本查询/index.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/2-7. 函数和分组/index.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/1-6. 文件IO/myfiles/2.txt:
--------------------------------------------------------------------------------
1 | abcde
--------------------------------------------------------------------------------
/1-6. 文件IO/myfiles/sub/3.txt:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/3-2. Sequelize简介/index.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-13. jwt/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-8. 断点调试/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/1-2. 全局对象/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
--------------------------------------------------------------------------------
/1-6. 文件IO/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
--------------------------------------------------------------------------------
/4-10. 跨域之CORS/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-10. 跨域之CORS/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-11. CORS中间件/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-11. CORS中间件/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-12. session/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-12. session/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-13. jwt/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-25. 场景 - 客户端缓存/public/1.asaf.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-5. express路由/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-7. 实现登陆和认证/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-7. 实现登陆和认证/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-8. 断点调试/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-9. 跨域之JSONP/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-9. 跨域之JSONP/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/5-4. CSRF攻击和防御/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/1-5. 基本内置模块/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
--------------------------------------------------------------------------------
/1-6. 文件IO/myfiles/1.txt:
--------------------------------------------------------------------------------
1 | abc阿斯顿发发放到发
--------------------------------------------------------------------------------
/1-6. 文件IO/myfiles/1/3.txt:
--------------------------------------------------------------------------------
1 | assafasdf
--------------------------------------------------------------------------------
/1-6. 文件IO/myfiles/1/6.txt:
--------------------------------------------------------------------------------
1 | asfasfasdf
--------------------------------------------------------------------------------
/4-14. 登录和认证-服务器开发/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-14. 登录和认证-服务器开发/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-15. 登录和认证-客户端开发/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-15. 登录和认证-客户端开发/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-16. 场景 - 日志记录/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-16. 场景 - 日志记录/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-17. 场景 - 文件上传/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-17. 场景 - 文件上传/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-18. 场景 - 文件下载/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-18. 场景 - 文件下载/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-19. 场景 - 图片水印/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-19. 场景 - 图片水印/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-20. 场景 - 图片防盗链/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-20. 场景 - 图片防盗链/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-21. 重要场景 - 代理/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-21. 重要场景 - 代理/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-22. 扩展场景 - 模版引擎/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-22. 扩展场景 - 模版引擎/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-23. 场景 - 生成二维码/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-23. 场景 - 生成二维码/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-24. 场景 - 生成验证码/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-24. 场景 - 生成验证码/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-25. 场景 - 客户端缓存/public/1.asfdasdf.css:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-25. 场景 - 客户端缓存/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-25. 场景 - 客户端缓存/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-26. 场景 - 富文本框/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-5. express路由/routes/api/admin.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-5. express路由/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-6. cookie的基本概念/routes/api/book.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/4-6. cookie的基本概念/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/5-4. CSRF攻击和防御/routes/api/class.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/1-3. Node的模块化细节/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
--------------------------------------------------------------------------------
/1-4. 【扩展】Node中的ES模块/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
--------------------------------------------------------------------------------
/1-7. 文件流/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
--------------------------------------------------------------------------------
/4-16. 场景 - 日志记录/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
--------------------------------------------------------------------------------
/4-17. 场景 - 文件上传/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
--------------------------------------------------------------------------------
/4-18. 场景 - 文件下载/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
--------------------------------------------------------------------------------
/4-24. 场景 - 生成验证码/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
--------------------------------------------------------------------------------
/4-25. 场景 - 客户端缓存/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
--------------------------------------------------------------------------------
/4-26. 场景 - 富文本框/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
--------------------------------------------------------------------------------
/4-4. 常用中间件/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
2 |
--------------------------------------------------------------------------------
/4-8. 断点调试/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
2 |
--------------------------------------------------------------------------------
/1-8. net模块/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
--------------------------------------------------------------------------------
/4-10. 跨域之CORS/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
2 |
--------------------------------------------------------------------------------
/4-11. CORS中间件/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
2 |
--------------------------------------------------------------------------------
/4-13. jwt/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
2 |
3 |
--------------------------------------------------------------------------------
/4-14. 登录和认证-服务器开发/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
--------------------------------------------------------------------------------
/4-15. 登录和认证-客户端开发/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
--------------------------------------------------------------------------------
/4-20. 场景 - 图片防盗链/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
2 |
--------------------------------------------------------------------------------
/4-21. 重要场景 - 代理/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
2 |
--------------------------------------------------------------------------------
/4-3. express中间件/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
2 |
--------------------------------------------------------------------------------
/4-5. express路由/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
2 |
--------------------------------------------------------------------------------
/4-6. cookie的基本概念/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
2 |
--------------------------------------------------------------------------------
/4-7. 实现登陆和认证/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
2 |
--------------------------------------------------------------------------------
/4-9. 跨域之JSONP/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
2 |
--------------------------------------------------------------------------------
/5-4. CSRF攻击和防御/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
2 |
--------------------------------------------------------------------------------
/1-3. Node的模块化细节/ab.js:
--------------------------------------------------------------------------------
1 | console.log("module ab");
2 |
--------------------------------------------------------------------------------
/1-9. http模块/public/script/a.js:
--------------------------------------------------------------------------------
1 | alert("asfasfd");
2 |
--------------------------------------------------------------------------------
/3-3. 模型定义和同步/index.js:
--------------------------------------------------------------------------------
1 | require("./models/sync");
2 |
--------------------------------------------------------------------------------
/4-12. session/index.js:
--------------------------------------------------------------------------------
1 | require("./init");
2 |
3 |
--------------------------------------------------------------------------------
/4-4. 常用中间件/public/js/index.js:
--------------------------------------------------------------------------------
1 | console.log("abc");
2 |
--------------------------------------------------------------------------------
/4-8. 断点调试/public/js/index.js:
--------------------------------------------------------------------------------
1 | console.log("abc");
2 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | ~*.ppt*
3 | .DS_Store
4 |
5 |
--------------------------------------------------------------------------------
/1-10. https协议/public/script/a.js:
--------------------------------------------------------------------------------
1 | alert("asfasfd");
2 |
--------------------------------------------------------------------------------
/1-11. https模块/public/script/a.js:
--------------------------------------------------------------------------------
1 | alert("asfasfd");
2 |
--------------------------------------------------------------------------------
/1-9. http模块/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~$*.ppt*
--------------------------------------------------------------------------------
/2-4. 表记录的增删改/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
--------------------------------------------------------------------------------
/2-5. 单表基本查询/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
--------------------------------------------------------------------------------
/2-5. 单表基本查询/limit.sql:
--------------------------------------------------------------------------------
1 | SELECT * from employee
2 | limit 2,3;
--------------------------------------------------------------------------------
/2-6. 联表查询/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
--------------------------------------------------------------------------------
/2-7. 函数和分组/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
--------------------------------------------------------------------------------
/3-10. 数据验证/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
--------------------------------------------------------------------------------
/3-3. 模型定义和同步/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
--------------------------------------------------------------------------------
/3-4. 模型的增删改/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
--------------------------------------------------------------------------------
/3-5. 模拟数据/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
--------------------------------------------------------------------------------
/3-6. 数据抓取/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
--------------------------------------------------------------------------------
/3-7. 数据查询/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
--------------------------------------------------------------------------------
/3-8. MD5加密/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
--------------------------------------------------------------------------------
/3-9. moment/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
--------------------------------------------------------------------------------
/4-5. express路由/public/js/index.js:
--------------------------------------------------------------------------------
1 | console.log("abc");
2 |
--------------------------------------------------------------------------------
/4-7. 实现登陆和认证/public/js/index.js:
--------------------------------------------------------------------------------
1 | console.log("abc");
2 |
--------------------------------------------------------------------------------
/1-10. https协议/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~$*.ppt*
--------------------------------------------------------------------------------
/1-11. https模块/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~$*.ppt*
--------------------------------------------------------------------------------
/1-12. node生命周期/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
--------------------------------------------------------------------------------
/1-3. Node的模块化细节/a.json:
--------------------------------------------------------------------------------
1 | {
2 | "a": 1,
3 | "b": 2
4 | }
5 |
--------------------------------------------------------------------------------
/3-1. mysql驱动程序/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
--------------------------------------------------------------------------------
/3-11. 访问器和虚拟字段/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
--------------------------------------------------------------------------------
/3-2. Sequelize简介/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
--------------------------------------------------------------------------------
/4-6. cookie的基本概念/public/js/index.js:
--------------------------------------------------------------------------------
1 | console.log("abc");
2 |
--------------------------------------------------------------------------------
/5-6. NodeJS组成原理/index.js:
--------------------------------------------------------------------------------
1 | console.log(arguments.length);
2 |
--------------------------------------------------------------------------------
/2-4. 表记录的增删改/delete.sql:
--------------------------------------------------------------------------------
1 | DELETE FROM student
2 | WHERE `name`='袁哥';
--------------------------------------------------------------------------------
/3-12. 日志记录/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/*
--------------------------------------------------------------------------------
/4-4. 常用中间件/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/*
--------------------------------------------------------------------------------
/1-11. https模块/ca-cert.srl:
--------------------------------------------------------------------------------
1 | 539DAE571A232A3C5D4DAABD66429E59ACEAA0F9
2 |
--------------------------------------------------------------------------------
/1-13. [扩展] EventEmitter/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
--------------------------------------------------------------------------------
/2-4. 表记录的增删改/update.sql:
--------------------------------------------------------------------------------
1 | UPDATE student SET `name`='邓旭名'
2 | WHERE id=12;
--------------------------------------------------------------------------------
/4-2. nodemon/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/*
--------------------------------------------------------------------------------
/4-3. express中间件/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/*
--------------------------------------------------------------------------------
/4-5. express路由/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/*
--------------------------------------------------------------------------------
/4-7. 实现登陆和认证/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 |
--------------------------------------------------------------------------------
/4-8. 断点调试/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 |
--------------------------------------------------------------------------------
/1-4. 【扩展】Node中的ES模块/index.mjs:
--------------------------------------------------------------------------------
1 | import("./a.mjs").then(r => console.log(r));
2 |
--------------------------------------------------------------------------------
/3-10. 数据验证/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/3-12. 日志记录/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-1. express的基本使用/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/*
--------------------------------------------------------------------------------
/4-10. 跨域之CORS/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-11. CORS中间件/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-12. session/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-13. jwt/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-2. nodemon/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
--------------------------------------------------------------------------------
/4-2. nodemon/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-4. 常用中间件/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-6. cookie的基本概念/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 |
--------------------------------------------------------------------------------
/4-7. 实现登陆和认证/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-8. 断点调试/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-9. 跨域之JSONP/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/5-4. CSRF攻击和防御/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 |
--------------------------------------------------------------------------------
/NodeJS.xmind:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/NodeJS.xmind
--------------------------------------------------------------------------------
/2-6. 联表查询/distinct.sql:
--------------------------------------------------------------------------------
1 | -- 所有员工分布的地址
2 |
3 | select DISTINCT location from employee;
--------------------------------------------------------------------------------
/3-10. 数据验证/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 |
--------------------------------------------------------------------------------
/3-11. 访问器和虚拟字段/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/3-12. 日志记录/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 |
--------------------------------------------------------------------------------
/4-1. express的基本使用/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-14. 登录和认证-服务器开发/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-15. 登录和认证-客户端开发/client/.browserslistrc:
--------------------------------------------------------------------------------
1 | > 1%
2 | last 2 versions
3 | not dead
4 |
--------------------------------------------------------------------------------
/4-15. 登录和认证-客户端开发/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-16. 场景 - 日志记录/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-17. 场景 - 文件上传/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-18. 场景 - 文件下载/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-19. 场景 - 图片水印/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-20. 场景 - 图片防盗链/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-21. 重要场景 - 代理/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-22. 扩展场景 - 模版引擎/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-23. 场景 - 生成二维码/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-24. 场景 - 生成验证码/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-25. 场景 - 客户端缓存/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-26. 场景 - 富文本框/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-3. express中间件/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-5. express路由/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/4-6. cookie的基本概念/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/5-4. CSRF攻击和防御/models/init.js:
--------------------------------------------------------------------------------
1 | require("./relation");
2 | require("./sync");
3 |
--------------------------------------------------------------------------------
/3-11. 访问器和虚拟字段/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 |
--------------------------------------------------------------------------------
/3-5. 模拟数据/index.js:
--------------------------------------------------------------------------------
1 | require("./models/relation");
2 | require("./mock/mockStudent");
3 |
--------------------------------------------------------------------------------
/3-6. 数据抓取/index.js:
--------------------------------------------------------------------------------
1 | require("./models/relation");
2 | require("./spider/fetchBooks");
3 |
--------------------------------------------------------------------------------
/4-1. express的基本使用/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 |
--------------------------------------------------------------------------------
/4-10. 跨域之CORS/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 |
--------------------------------------------------------------------------------
/4-11. CORS中间件/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 |
--------------------------------------------------------------------------------
/4-12. session/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 |
--------------------------------------------------------------------------------
/4-13. jwt/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 |
--------------------------------------------------------------------------------
/4-13. jwt/public/css/index.css:
--------------------------------------------------------------------------------
1 | body{
2 | background: #000;
3 | color: #fff;
4 | }
--------------------------------------------------------------------------------
/4-8. 断点调试/public/css/index.css:
--------------------------------------------------------------------------------
1 | body{
2 | background: #000;
3 | color: #fff;
4 | }
--------------------------------------------------------------------------------
/4-9. 跨域之JSONP/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 |
--------------------------------------------------------------------------------
/1-8. net模块/hsq.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/1-8. net模块/hsq.jpg
--------------------------------------------------------------------------------
/1-9. http模块/public/css/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | background: #333;
3 | color: #000;
4 | }
5 |
--------------------------------------------------------------------------------
/3-10. 数据验证/三层架构.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/3-10. 数据验证/三层架构.jpg
--------------------------------------------------------------------------------
/3-12. 日志记录/三层架构.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/3-12. 日志记录/三层架构.jpg
--------------------------------------------------------------------------------
/3-5. 模拟数据/三层架构.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/3-5. 模拟数据/三层架构.jpg
--------------------------------------------------------------------------------
/3-6. 数据抓取/三层架构.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/3-6. 数据抓取/三层架构.jpg
--------------------------------------------------------------------------------
/3-7. 数据查询/三层架构.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/3-7. 数据查询/三层架构.jpg
--------------------------------------------------------------------------------
/3-8. MD5加密/三层架构.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/3-8. MD5加密/三层架构.jpg
--------------------------------------------------------------------------------
/4-10. 跨域之CORS/public/css/index.css:
--------------------------------------------------------------------------------
1 | body{
2 | background: #000;
3 | color: #fff;
4 | }
--------------------------------------------------------------------------------
/4-11. CORS中间件/public/css/index.css:
--------------------------------------------------------------------------------
1 | body{
2 | background: #000;
3 | color: #fff;
4 | }
--------------------------------------------------------------------------------
/4-12. session/public/css/index.css:
--------------------------------------------------------------------------------
1 | body{
2 | background: #000;
3 | color: #fff;
4 | }
--------------------------------------------------------------------------------
/4-14. 登录和认证-服务器开发/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 |
--------------------------------------------------------------------------------
/4-15. 登录和认证-客户端开发/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 |
--------------------------------------------------------------------------------
/4-16. 场景 - 日志记录/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 |
--------------------------------------------------------------------------------
/4-4. 常用中间件/public/css/index.css:
--------------------------------------------------------------------------------
1 | body{
2 | background: #000;
3 | color: #fff;
4 | }
--------------------------------------------------------------------------------
/4-4. 常用中间件/三层架构.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-4. 常用中间件/三层架构.jpg
--------------------------------------------------------------------------------
/4-5. express路由/public/css/index.css:
--------------------------------------------------------------------------------
1 | body{
2 | background: #000;
3 | color: #fff;
4 | }
--------------------------------------------------------------------------------
/4-7. 实现登陆和认证/public/css/index.css:
--------------------------------------------------------------------------------
1 | body{
2 | background: #000;
3 | color: #fff;
4 | }
--------------------------------------------------------------------------------
/4-8. 断点调试/三层架构.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-8. 断点调试/三层架构.jpg
--------------------------------------------------------------------------------
/4-9. 跨域之JSONP/public/css/index.css:
--------------------------------------------------------------------------------
1 | body{
2 | background: #000;
3 | color: #fff;
4 | }
--------------------------------------------------------------------------------
/1-10. https协议/public/css/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | background: #333;
3 | color: #000;
4 | }
5 |
--------------------------------------------------------------------------------
/1-10. https协议/演示.pptx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/1-10. https协议/演示.pptx
--------------------------------------------------------------------------------
/1-11. https模块/public/css/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | background: #333;
3 | color: #000;
4 | }
5 |
--------------------------------------------------------------------------------
/1-11. https模块/演示.pptx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/1-11. https模块/演示.pptx
--------------------------------------------------------------------------------
/1-12. node生命周期/课件.pptx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/1-12. node生命周期/课件.pptx
--------------------------------------------------------------------------------
/3-12. 日志记录/log等级.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/3-12. 日志记录/log等级.jpg
--------------------------------------------------------------------------------
/3-4. 模型的增删改/三层架构.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/3-4. 模型的增删改/三层架构.jpg
--------------------------------------------------------------------------------
/3-9. moment/三层架构.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/3-9. moment/三层架构.jpg
--------------------------------------------------------------------------------
/3-9. moment/时间处理模式.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/3-9. moment/时间处理模式.jpg
--------------------------------------------------------------------------------
/4-10. 跨域之CORS/三层架构.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-10. 跨域之CORS/三层架构.jpg
--------------------------------------------------------------------------------
/4-11. CORS中间件/三层架构.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-11. CORS中间件/三层架构.jpg
--------------------------------------------------------------------------------
/4-12. session/三层架构.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-12. session/三层架构.jpg
--------------------------------------------------------------------------------
/4-14. 登录和认证-服务器开发/public/css/index.css:
--------------------------------------------------------------------------------
1 | body{
2 | background: #000;
3 | color: #fff;
4 | }
--------------------------------------------------------------------------------
/4-2. nodemon/三层架构.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-2. nodemon/三层架构.jpg
--------------------------------------------------------------------------------
/4-4. 常用中间件/中间件示意图.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-4. 常用中间件/中间件示意图.jpg
--------------------------------------------------------------------------------
/4-6. cookie的基本概念/public/css/index.css:
--------------------------------------------------------------------------------
1 | body{
2 | background: #000;
3 | color: #fff;
4 | }
--------------------------------------------------------------------------------
/4-7. 实现登陆和认证/三层架构.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-7. 实现登陆和认证/三层架构.jpg
--------------------------------------------------------------------------------
/4-9. 跨域之JSONP/三层架构.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-9. 跨域之JSONP/三层架构.jpg
--------------------------------------------------------------------------------
/1-6. 文件IO/myfiles/1.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/1-6. 文件IO/myfiles/1.jpeg
--------------------------------------------------------------------------------
/3-11. 访问器和虚拟字段/三层架构.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/3-11. 访问器和虚拟字段/三层架构.jpg
--------------------------------------------------------------------------------
/3-3. 模型定义和同步/ORM原理图.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/3-3. 模型定义和同步/ORM原理图.jpg
--------------------------------------------------------------------------------
/4-17. 场景 - 文件上传/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 | public/upload
--------------------------------------------------------------------------------
/4-19. 场景 - 图片水印/new.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-19. 场景 - 图片水印/new.jpg
--------------------------------------------------------------------------------
/4-3. express中间件/三层架构.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-3. express中间件/三层架构.jpg
--------------------------------------------------------------------------------
/4-5. express路由/三层架构.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-5. express路由/三层架构.jpg
--------------------------------------------------------------------------------
/3-2. Sequelize简介/ORM原理图.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/3-2. Sequelize简介/ORM原理图.jpg
--------------------------------------------------------------------------------
/4-1. express的基本使用/log等级.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-1. express的基本使用/log等级.jpg
--------------------------------------------------------------------------------
/4-1. express的基本使用/三层架构.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-1. express的基本使用/三层架构.jpg
--------------------------------------------------------------------------------
/4-12. session/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
--------------------------------------------------------------------------------
/4-13. jwt/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
--------------------------------------------------------------------------------
/4-19. 场景 - 图片水印/origin.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-19. 场景 - 图片水印/origin.jpg
--------------------------------------------------------------------------------
/4-19. 场景 - 图片水印/water.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-19. 场景 - 图片水印/water.jpg
--------------------------------------------------------------------------------
/4-21. 重要场景 - 代理/代理服务器.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-21. 重要场景 - 代理/代理服务器.jpg
--------------------------------------------------------------------------------
/4-23. 场景 - 生成二维码/code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-23. 场景 - 生成二维码/code.png
--------------------------------------------------------------------------------
/4-3. express中间件/中间件示意图.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-3. express中间件/中间件示意图.jpg
--------------------------------------------------------------------------------
/4-6. cookie的基本概念/三层架构.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-6. cookie的基本概念/三层架构.jpg
--------------------------------------------------------------------------------
/1-6. 文件IO/myfiles/1.copy.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/1-6. 文件IO/myfiles/1.copy.jpeg
--------------------------------------------------------------------------------
/4-10. 跨域之CORS/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
4 |
--------------------------------------------------------------------------------
/4-11. CORS中间件/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
4 |
--------------------------------------------------------------------------------
/4-14. 登录和认证-服务器开发/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
--------------------------------------------------------------------------------
/4-15. 登录和认证-客户端开发/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
--------------------------------------------------------------------------------
/4-16. 场景 - 日志记录/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
--------------------------------------------------------------------------------
/4-17. 场景 - 文件上传/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
--------------------------------------------------------------------------------
/4-18. 场景 - 文件下载/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
--------------------------------------------------------------------------------
/4-19. 场景 - 图片水印/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
--------------------------------------------------------------------------------
/4-20. 场景 - 图片防盗链/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
--------------------------------------------------------------------------------
/4-21. 重要场景 - 代理/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
--------------------------------------------------------------------------------
/4-22. 扩展场景 - 模版引擎/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
--------------------------------------------------------------------------------
/4-22. 扩展场景 - 模版引擎/两种渲染方式.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-22. 扩展场景 - 模版引擎/两种渲染方式.jpg
--------------------------------------------------------------------------------
/4-23. 场景 - 生成二维码/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
--------------------------------------------------------------------------------
/4-24. 场景 - 生成验证码/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
--------------------------------------------------------------------------------
/4-25. 场景 - 客户端缓存/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
--------------------------------------------------------------------------------
/4-26. 场景 - 富文本框/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
--------------------------------------------------------------------------------
/4-4. 常用中间件/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
4 |
--------------------------------------------------------------------------------
/4-7. 实现登陆和认证/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
4 |
--------------------------------------------------------------------------------
/4-8. 断点调试/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
4 |
--------------------------------------------------------------------------------
/4-9. 跨域之JSONP/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
4 |
--------------------------------------------------------------------------------
/4-12. session/session原理示意图.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-12. session/session原理示意图.jpg
--------------------------------------------------------------------------------
/4-18. 场景 - 文件下载/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 | public/upload
7 | resources
--------------------------------------------------------------------------------
/4-3. express中间件/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
4 |
--------------------------------------------------------------------------------
/4-5. express路由/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
4 |
--------------------------------------------------------------------------------
/4-6. cookie的基本概念/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
4 |
--------------------------------------------------------------------------------
/5-4. CSRF攻击和防御/init.js:
--------------------------------------------------------------------------------
1 | require("./models/init");
2 | require("./services/init");
3 | require("./routes/init");
4 |
--------------------------------------------------------------------------------
/5-4. CSRF攻击和防御/public/css/index.css:
--------------------------------------------------------------------------------
1 | body {
2 | background: #000;
3 | color: #fff;
4 | padding: 20px;
5 | }
6 |
--------------------------------------------------------------------------------
/1-4. 【扩展】Node中的ES模块/a.mjs:
--------------------------------------------------------------------------------
1 | export default 5
2 | export const a = 1;
3 |
4 | // exports.b = 3;
5 | // exports.a = 5;
6 |
--------------------------------------------------------------------------------
/4-15. 登录和认证-客户端开发/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-15. 登录和认证-客户端开发/public/favicon.ico
--------------------------------------------------------------------------------
/4-19. 场景 - 图片水印/public/img/water.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-19. 场景 - 图片水印/public/img/water.jpg
--------------------------------------------------------------------------------
/4-20. 场景 - 图片防盗链/public/img/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-20. 场景 - 图片防盗链/public/img/logo.jpg
--------------------------------------------------------------------------------
/4-20. 场景 - 图片防盗链/public/img/water.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-20. 场景 - 图片防盗链/public/img/water.jpg
--------------------------------------------------------------------------------
/4-21. 重要场景 - 代理/public/img/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-21. 重要场景 - 代理/public/img/logo.jpg
--------------------------------------------------------------------------------
/4-21. 重要场景 - 代理/public/img/water.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-21. 重要场景 - 代理/public/img/water.jpg
--------------------------------------------------------------------------------
/4-22. 扩展场景 - 模版引擎/public/img/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-22. 扩展场景 - 模版引擎/public/img/logo.jpg
--------------------------------------------------------------------------------
/4-23. 场景 - 生成二维码/public/img/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-23. 场景 - 生成二维码/public/img/logo.jpg
--------------------------------------------------------------------------------
/4-23. 场景 - 生成二维码/public/img/water.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-23. 场景 - 生成二维码/public/img/water.jpg
--------------------------------------------------------------------------------
/4-24. 场景 - 生成验证码/public/img/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-24. 场景 - 生成验证码/public/img/logo.jpg
--------------------------------------------------------------------------------
/4-24. 场景 - 生成验证码/public/img/water.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-24. 场景 - 生成验证码/public/img/water.jpg
--------------------------------------------------------------------------------
/4-25. 场景 - 客户端缓存/public/img/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-25. 场景 - 客户端缓存/public/img/logo.jpg
--------------------------------------------------------------------------------
/4-25. 场景 - 客户端缓存/public/img/water.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-25. 场景 - 客户端缓存/public/img/water.jpg
--------------------------------------------------------------------------------
/4-26. 场景 - 富文本框/public/img/logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-26. 场景 - 富文本框/public/img/logo.jpg
--------------------------------------------------------------------------------
/4-26. 场景 - 富文本框/public/img/water.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-26. 场景 - 富文本框/public/img/water.jpg
--------------------------------------------------------------------------------
/1-3. Node的模块化细节/src/index.js:
--------------------------------------------------------------------------------
1 | // console.log("src index module");
2 |
3 | // console.log(module);
4 |
5 | console.log(require)
6 |
--------------------------------------------------------------------------------
/4-13. jwt/client/readme.md:
--------------------------------------------------------------------------------
1 | 这里面搭建vue工程(react)
2 |
3 | 1. 配置build的路径,把build之后的代码放到../public中
4 | 2. 或者,改动服务器的静态资源目录,改动到client/dist目录中
--------------------------------------------------------------------------------
/4-15. 登录和认证-客户端开发/client/babel.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | presets: [
3 | '@vue/cli-plugin-babel/preset'
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/4-22. 扩展场景 - 模版引擎/public/img/water.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-22. 扩展场景 - 模版引擎/public/img/water.jpg
--------------------------------------------------------------------------------
/4-4. 常用中间件/client/readme.md:
--------------------------------------------------------------------------------
1 | 这里面搭建vue工程(react)
2 |
3 | 1. 配置build的路径,把build之后的代码放到../public中
4 | 2. 或者,改动服务器的静态资源目录,改动到client/dist目录中
--------------------------------------------------------------------------------
/4-8. 断点调试/client/readme.md:
--------------------------------------------------------------------------------
1 | 这里面搭建vue工程(react)
2 |
3 | 1. 配置build的路径,把build之后的代码放到../public中
4 | 2. 或者,改动服务器的静态资源目录,改动到client/dist目录中
--------------------------------------------------------------------------------
/4-10. 跨域之CORS/client/readme.md:
--------------------------------------------------------------------------------
1 | 这里面搭建vue工程(react)
2 |
3 | 1. 配置build的路径,把build之后的代码放到../public中
4 | 2. 或者,改动服务器的静态资源目录,改动到client/dist目录中
--------------------------------------------------------------------------------
/4-11. CORS中间件/client/readme.md:
--------------------------------------------------------------------------------
1 | 这里面搭建vue工程(react)
2 |
3 | 1. 配置build的路径,把build之后的代码放到../public中
4 | 2. 或者,改动服务器的静态资源目录,改动到client/dist目录中
--------------------------------------------------------------------------------
/4-12. session/client/readme.md:
--------------------------------------------------------------------------------
1 | 这里面搭建vue工程(react)
2 |
3 | 1. 配置build的路径,把build之后的代码放到../public中
4 | 2. 或者,改动服务器的静态资源目录,改动到client/dist目录中
--------------------------------------------------------------------------------
/4-19. 场景 - 图片水印/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 | public/upload
7 | resources
8 | public/origin
--------------------------------------------------------------------------------
/4-20. 场景 - 图片防盗链/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 | public/upload
7 | resources
8 | public/origin
--------------------------------------------------------------------------------
/4-21. 重要场景 - 代理/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 | public/upload
7 | resources
8 | public/origin
--------------------------------------------------------------------------------
/4-22. 扩展场景 - 模版引擎/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 | public/upload
7 | resources
8 | public/origin
--------------------------------------------------------------------------------
/4-23. 场景 - 生成二维码/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 | public/upload
7 | resources
8 | public/origin
--------------------------------------------------------------------------------
/4-24. 场景 - 生成验证码/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 | public/upload
7 | resources
8 | public/origin
--------------------------------------------------------------------------------
/4-25. 场景 - 客户端缓存/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 | public/upload
7 | resources
8 | public/origin
--------------------------------------------------------------------------------
/4-26. 场景 - 富文本框/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 | public/upload
7 | resources
8 | public/origin
--------------------------------------------------------------------------------
/4-5. express路由/client/readme.md:
--------------------------------------------------------------------------------
1 | 这里面搭建vue工程(react)
2 |
3 | 1. 配置build的路径,把build之后的代码放到../public中
4 | 2. 或者,改动服务器的静态资源目录,改动到client/dist目录中
--------------------------------------------------------------------------------
/4-6. cookie的基本概念/client/readme.md:
--------------------------------------------------------------------------------
1 | 这里面搭建vue工程(react)
2 |
3 | 1. 配置build的路径,把build之后的代码放到../public中
4 | 2. 或者,改动服务器的静态资源目录,改动到client/dist目录中
--------------------------------------------------------------------------------
/4-7. 实现登陆和认证/client/readme.md:
--------------------------------------------------------------------------------
1 | 这里面搭建vue工程(react)
2 |
3 | 1. 配置build的路径,把build之后的代码放到../public中
4 | 2. 或者,改动服务器的静态资源目录,改动到client/dist目录中
--------------------------------------------------------------------------------
/4-9. 跨域之JSONP/client/readme.md:
--------------------------------------------------------------------------------
1 | 这里面搭建vue工程(react)
2 |
3 | 1. 配置build的路径,把build之后的代码放到../public中
4 | 2. 或者,改动服务器的静态资源目录,改动到client/dist目录中
--------------------------------------------------------------------------------
/5-4. CSRF攻击和防御/client/readme.md:
--------------------------------------------------------------------------------
1 | 这里面搭建vue工程(react)
2 |
3 | 1. 配置build的路径,把build之后的代码放到../public中
4 | 2. 或者,改动服务器的静态资源目录,改动到client/dist目录中
--------------------------------------------------------------------------------
/5-5. XSS攻击和防御/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 | public/upload
7 | public/origin
8 | resources
9 |
--------------------------------------------------------------------------------
/5-7. 进程和线程/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 | public/upload
7 | public/origin
8 | resources
9 |
--------------------------------------------------------------------------------
/2-5. 单表基本查询/order by.sql:
--------------------------------------------------------------------------------
1 | SELECT *, case ismale
2 | when 1 then '男'
3 | else '女'
4 | end sex from employee
5 | ORDER BY sex asc, salary desc;
--------------------------------------------------------------------------------
/4-14. 登录和认证-服务器开发/client/readme.md:
--------------------------------------------------------------------------------
1 | 这里面搭建vue工程(react)
2 |
3 | 1. 配置build的路径,把build之后的代码放到../public中
4 | 2. 或者,改动服务器的静态资源目录,改动到client/dist目录中
--------------------------------------------------------------------------------
/4-15. 登录和认证-客户端开发/client/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-15. 登录和认证-客户端开发/client/public/favicon.ico
--------------------------------------------------------------------------------
/4-15. 登录和认证-客户端开发/client/src/assets/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-15. 登录和认证-客户端开发/client/src/assets/logo.png
--------------------------------------------------------------------------------
/5-1. websocket原理/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 | public/upload
7 | public/origin
8 | resources
9 |
--------------------------------------------------------------------------------
/5-2. socket.io/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 | public/upload
7 | public/origin
8 | resources
9 |
--------------------------------------------------------------------------------
/5-3. [扩展]在线聊天室/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 | public/upload
7 | public/origin
8 | resources
9 |
--------------------------------------------------------------------------------
/5-6. NodeJS组成原理/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | temp/
3 | ~*.ppt*
4 | logs/
5 | .DS_Store
6 | public/upload
7 | public/origin
8 | resources
9 |
--------------------------------------------------------------------------------
/1-7. 文件流/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/4-15. 登录和认证-客户端开发/public/img/logo.82b9c7a5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/DuYi-Edu/DuYi-Node/HEAD/4-15. 登录和认证-客户端开发/public/img/logo.82b9c7a5.png
--------------------------------------------------------------------------------
/1-10. https协议/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/1-11. https模块/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/1-2. 全局对象/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/1-5. 基本内置模块/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/1-6. 文件IO/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/1-8. net模块/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/1-9. http模块/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/2-4. 表记录的增删改/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/2-5. 单表基本查询/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/2-6. 联表查询/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/2-7. 函数和分组/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/3-10. 数据验证/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/3-12. 日志记录/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/3-3. 模型定义和同步/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/3-4. 模型的增删改/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/3-5. 模拟数据/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/3-6. 数据抓取/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/3-7. 数据查询/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/3-8. MD5加密/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/3-9. moment/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/1-12. node生命周期/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/1-3. Node的模块化细节/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/3-1. mysql驱动程序/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/3-11. 访问器和虚拟字段/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/3-2. Sequelize简介/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/4-1. express的基本使用/readme.md:
--------------------------------------------------------------------------------
1 | 每一节课都是一个分支,分支名为课程名称编号
2 |
3 | 要切换到相应的课程,仅需切换分支即可
4 |
5 | 例如要切换到第一章第一节课,运行下面的命令即可:
6 |
7 | ```shell
8 | git checkout 1-1
9 | ```
--------------------------------------------------------------------------------
/4-15. 登录和认证-客户端开发/client/src/views/Protect.vue:
--------------------------------------------------------------------------------
1 |
2 | 这是一个受保护的页面,必须要登录后才能访问
4 |
4 | 这是首页,能匿名访问
5 |
10 |
11 |
--------------------------------------------------------------------------------
/4-21. 重要场景 - 代理/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/4-22. 扩展场景 - 模版引擎/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
10 |
11 |
--------------------------------------------------------------------------------
/3-7. 数据查询/index copy.js:
--------------------------------------------------------------------------------
1 | require("./models/relation");
2 | // require("./spider/fetchBooks");
3 | const adminServ = require("./services/adminService");
4 | // adminServ.login("bcd", "abc").then((r) => {
5 | // console.log(r);
6 | // });
7 | adminServ.getAdminById(1).then((r) => {
8 | console.log(r);
9 | });
10 |
--------------------------------------------------------------------------------
/4-3. express中间件/routes/staticMiddleware.js:
--------------------------------------------------------------------------------
1 | module.exports = (req, res, next) => {
2 | if (req.path.startsWith("/api")) {
3 | // 说明你请求的是 api 接口
4 | next();
5 | } else {
6 | // 说明你想要的是静态资源
7 | if (true) {
8 | res.send("静态资源");
9 | } else {
10 | next();
11 | }
12 | }
13 | };
14 |
--------------------------------------------------------------------------------
/2-7. 函数和分组/字符串和日期函数.sql:
--------------------------------------------------------------------------------
1 | SELECT CONCAT_WS('@', `name`,salary)
2 | FROM employee;
3 |
4 | SELECT CURDATE();
5 |
6 | SELECT CURTIME();
7 |
8 | SELECT TIMESTAMPDIFF(DAY,'2010-1-1 11:11:11','2010-1-2 11:11:12');
9 |
10 | SELECT *,
11 | TIMESTAMPDIFF(YEAR, birthday, CURDATE()) as age
12 | from employee
13 | ORDER BY age;
--------------------------------------------------------------------------------
/3-5. 模拟数据/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/3-6. 数据抓取/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/3-7. 数据查询/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-13. jwt/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-8. 断点调试/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/3-10. 数据验证/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/3-10. 数据验证/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/3-11. 访问器和虚拟字段/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/3-12. 日志记录/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/3-12. 日志记录/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/3-8. MD5加密/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/3-9. moment/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-10. 跨域之CORS/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-11. CORS中间件/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-12. session/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-13. jwt/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-2. nodemon/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-2. nodemon/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-4. 常用中间件/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-4. 常用中间件/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-5. express路由/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-7. 实现登陆和认证/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-7. 实现登陆和认证/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-8. 断点调试/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-9. 跨域之JSONP/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/5-4. CSRF攻击和防御/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/1-5. 基本内置模块/about os.js:
--------------------------------------------------------------------------------
1 | const os = require("os");
2 |
3 | // console.log(os.EOL);
4 |
5 | // console.log(os.arch())
6 |
7 | // console.log(os.cpus().length);
8 |
9 | // console.log(os.freemem() / 2 ** 30);
10 |
11 | // console.log(os.homedir());
12 |
13 | // console.log(os.hostname());
14 |
15 | console.log(os.tmpdir());
16 |
--------------------------------------------------------------------------------
/3-11. 访问器和虚拟字段/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-1. express的基本使用/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-1. express的基本使用/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-10. 跨域之CORS/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-11. CORS中间件/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-12. session/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-14. 登录和认证-服务器开发/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-14. 登录和认证-服务器开发/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-15. 登录和认证-客户端开发/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-15. 登录和认证-客户端开发/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-16. 场景 - 日志记录/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-16. 场景 - 日志记录/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-17. 场景 - 文件上传/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-17. 场景 - 文件上传/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-18. 场景 - 文件下载/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-18. 场景 - 文件下载/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-19. 场景 - 图片水印/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-19. 场景 - 图片水印/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-20. 场景 - 图片防盗链/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-20. 场景 - 图片防盗链/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-21. 重要场景 - 代理/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-21. 重要场景 - 代理/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-22. 扩展场景 - 模版引擎/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-22. 扩展场景 - 模版引擎/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-23. 场景 - 生成二维码/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-23. 场景 - 生成二维码/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-24. 场景 - 生成验证码/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-24. 场景 - 生成验证码/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-25. 场景 - 客户端缓存/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-25. 场景 - 客户端缓存/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-26. 场景 - 富文本框/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-26. 场景 - 富文本框/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-3. express中间件/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-3. express中间件/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-5. express路由/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-6. cookie的基本概念/mock/mockClass.js:
--------------------------------------------------------------------------------
1 | const Mock = require("mockjs");
2 | const result = Mock.mock({
3 | "datas|16": [
4 | {
5 | "id|+1": 1,
6 | name: "前端第 @id 期",
7 | openDate: "@date",
8 | },
9 | ],
10 | }).datas;
11 |
12 | const Class = require("../models/Class");
13 | Class.bulkCreate(result);
14 |
--------------------------------------------------------------------------------
/4-6. cookie的基本概念/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-9. 跨域之JSONP/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/5-4. CSRF攻击和防御/util/propertyHelper.js:
--------------------------------------------------------------------------------
1 | exports.pick = function (obj, ...props) {
2 | if (!obj || typeof obj !== "object") {
3 | return obj;
4 | }
5 | const newObj = {};
6 | for (const key in obj) {
7 | if (props.includes(key)) {
8 | newObj[key] = obj[key];
9 | }
10 | }
11 | return newObj;
12 | };
13 |
--------------------------------------------------------------------------------
/4-22. 扩展场景 - 模版引擎/test.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |