├── ##CSS-note##
├── css.md
├── css世界.md
├── css书写规范和顺序.md
├── 文本溢出.md
└── 详细
│ └── BFC.md
├── ##front高级##
├── http消息头
│ └── http消息头.md
├── mock
│ ├── mock.md
│ └── random.md
├── react-vue-ng差别
│ └── react-vue-ng差别.md
├── restful
│ └── restfulAPI.md
├── 正则表达式
│ └── 正则表达式.md
└── 跨域
│ └── 讲义课件
│ ├── CORS
│ └── index.html
│ ├── JSONP.png
│ ├── JSONP
│ ├── 1.jsonp.html
│ ├── 1.jsonp.js
│ └── serverJSONP.js
│ ├── MESSAGE
│ ├── A.html
│ └── B.html
│ ├── NAME
│ ├── A.html
│ ├── B.html
│ └── proxy.html
│ ├── OA系统后台
│ ├── API.TXT
│ ├── config.js
│ ├── json
│ │ ├── 1.js
│ │ ├── customer.json
│ │ ├── department.json
│ │ ├── job.json
│ │ ├── user.json
│ │ └── visit.json
│ ├── node_modules
│ │ ├── .bin
│ │ │ ├── mime
│ │ │ └── mime.cmd
│ │ ├── accepts
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── array-flatten
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── array-flatten.js
│ │ │ └── package.json
│ │ ├── body-parser
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ ├── lib
│ │ │ │ ├── read.js
│ │ │ │ └── types
│ │ │ │ │ ├── json.js
│ │ │ │ │ ├── raw.js
│ │ │ │ │ ├── text.js
│ │ │ │ │ └── urlencoded.js
│ │ │ ├── node_modules
│ │ │ │ └── qs
│ │ │ │ │ ├── .editorconfig
│ │ │ │ │ ├── .eslintignore
│ │ │ │ │ ├── .eslintrc
│ │ │ │ │ ├── CHANGELOG.md
│ │ │ │ │ ├── LICENSE
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── dist
│ │ │ │ │ └── qs.js
│ │ │ │ │ ├── lib
│ │ │ │ │ ├── formats.js
│ │ │ │ │ ├── index.js
│ │ │ │ │ ├── parse.js
│ │ │ │ │ ├── stringify.js
│ │ │ │ │ └── utils.js
│ │ │ │ │ ├── package.json
│ │ │ │ │ └── test
│ │ │ │ │ ├── .eslintrc
│ │ │ │ │ ├── index.js
│ │ │ │ │ ├── parse.js
│ │ │ │ │ ├── stringify.js
│ │ │ │ │ └── utils.js
│ │ │ └── package.json
│ │ ├── bytes
│ │ │ ├── History.md
│ │ │ ├── LICENSE
│ │ │ ├── Readme.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── content-disposition
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── content-type
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── cookie-signature
│ │ │ ├── .npmignore
│ │ │ ├── History.md
│ │ │ ├── Readme.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── cookie
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── debug
│ │ │ ├── .coveralls.yml
│ │ │ ├── .eslintrc
│ │ │ ├── .npmignore
│ │ │ ├── .travis.yml
│ │ │ ├── CHANGELOG.md
│ │ │ ├── LICENSE
│ │ │ ├── Makefile
│ │ │ ├── README.md
│ │ │ ├── component.json
│ │ │ ├── karma.conf.js
│ │ │ ├── node.js
│ │ │ ├── package.json
│ │ │ └── src
│ │ │ │ ├── browser.js
│ │ │ │ ├── debug.js
│ │ │ │ ├── index.js
│ │ │ │ ├── inspector-log.js
│ │ │ │ └── node.js
│ │ ├── depd
│ │ │ ├── History.md
│ │ │ ├── LICENSE
│ │ │ ├── Readme.md
│ │ │ ├── index.js
│ │ │ ├── lib
│ │ │ │ ├── browser
│ │ │ │ │ └── index.js
│ │ │ │ └── compat
│ │ │ │ │ ├── callsite-tostring.js
│ │ │ │ │ ├── event-listener-count.js
│ │ │ │ │ └── index.js
│ │ │ └── package.json
│ │ ├── destroy
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── ee-first
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── encodeurl
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── escape-html
│ │ │ ├── LICENSE
│ │ │ ├── Readme.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── etag
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── express-session
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ ├── node_modules
│ │ │ │ ├── cookie
│ │ │ │ │ ├── HISTORY.md
│ │ │ │ │ ├── LICENSE
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── index.js
│ │ │ │ │ └── package.json
│ │ │ │ └── depd
│ │ │ │ │ ├── History.md
│ │ │ │ │ ├── LICENSE
│ │ │ │ │ ├── Readme.md
│ │ │ │ │ ├── index.js
│ │ │ │ │ ├── lib
│ │ │ │ │ └── browser
│ │ │ │ │ │ └── index.js
│ │ │ │ │ └── package.json
│ │ │ ├── package.json
│ │ │ └── session
│ │ │ │ ├── cookie.js
│ │ │ │ ├── memory.js
│ │ │ │ ├── session.js
│ │ │ │ └── store.js
│ │ ├── express
│ │ │ ├── History.md
│ │ │ ├── LICENSE
│ │ │ ├── Readme.md
│ │ │ ├── index.js
│ │ │ ├── lib
│ │ │ │ ├── application.js
│ │ │ │ ├── express.js
│ │ │ │ ├── middleware
│ │ │ │ │ ├── init.js
│ │ │ │ │ └── query.js
│ │ │ │ ├── request.js
│ │ │ │ ├── response.js
│ │ │ │ ├── router
│ │ │ │ │ ├── index.js
│ │ │ │ │ ├── layer.js
│ │ │ │ │ └── route.js
│ │ │ │ ├── utils.js
│ │ │ │ └── view.js
│ │ │ ├── node_modules
│ │ │ │ └── qs
│ │ │ │ │ ├── .editorconfig
│ │ │ │ │ ├── .eslintignore
│ │ │ │ │ ├── .eslintrc
│ │ │ │ │ ├── CHANGELOG.md
│ │ │ │ │ ├── LICENSE
│ │ │ │ │ ├── README.md
│ │ │ │ │ ├── dist
│ │ │ │ │ └── qs.js
│ │ │ │ │ ├── lib
│ │ │ │ │ ├── formats.js
│ │ │ │ │ ├── index.js
│ │ │ │ │ ├── parse.js
│ │ │ │ │ ├── stringify.js
│ │ │ │ │ └── utils.js
│ │ │ │ │ ├── package.json
│ │ │ │ │ └── test
│ │ │ │ │ ├── .eslintrc
│ │ │ │ │ ├── index.js
│ │ │ │ │ ├── parse.js
│ │ │ │ │ ├── stringify.js
│ │ │ │ │ └── utils.js
│ │ │ └── package.json
│ │ ├── finalhandler
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── forwarded
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── fresh
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── http-errors
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── iconv-lite
│ │ │ ├── Changelog.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── encodings
│ │ │ │ ├── dbcs-codec.js
│ │ │ │ ├── dbcs-data.js
│ │ │ │ ├── index.js
│ │ │ │ ├── internal.js
│ │ │ │ ├── sbcs-codec.js
│ │ │ │ ├── sbcs-data-generated.js
│ │ │ │ ├── sbcs-data.js
│ │ │ │ ├── tables
│ │ │ │ │ ├── big5-added.json
│ │ │ │ │ ├── cp936.json
│ │ │ │ │ ├── cp949.json
│ │ │ │ │ ├── cp950.json
│ │ │ │ │ ├── eucjp.json
│ │ │ │ │ ├── gb18030-ranges.json
│ │ │ │ │ ├── gbk-added.json
│ │ │ │ │ └── shiftjis.json
│ │ │ │ ├── utf16.js
│ │ │ │ └── utf7.js
│ │ │ ├── lib
│ │ │ │ ├── bom-handling.js
│ │ │ │ ├── extend-node.js
│ │ │ │ ├── index.d.ts
│ │ │ │ ├── index.js
│ │ │ │ └── streams.js
│ │ │ └── package.json
│ │ ├── inherits
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── inherits.js
│ │ │ ├── inherits_browser.js
│ │ │ └── package.json
│ │ ├── ipaddr.js
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── ipaddr.min.js
│ │ │ ├── lib
│ │ │ │ ├── ipaddr.js
│ │ │ │ └── ipaddr.js.d.ts
│ │ │ └── package.json
│ │ ├── media-typer
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── merge-descriptors
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── methods
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── mime-db
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── db.json
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── mime-types
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── mime
│ │ │ ├── .npmignore
│ │ │ ├── CHANGELOG.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── cli.js
│ │ │ ├── mime.js
│ │ │ ├── package.json
│ │ │ ├── src
│ │ │ │ ├── build.js
│ │ │ │ └── test.js
│ │ │ └── types.json
│ │ ├── ms
│ │ │ ├── index.js
│ │ │ ├── license.md
│ │ │ ├── package.json
│ │ │ └── readme.md
│ │ ├── negotiator
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ ├── lib
│ │ │ │ ├── charset.js
│ │ │ │ ├── encoding.js
│ │ │ │ ├── language.js
│ │ │ │ └── mediaType.js
│ │ │ └── package.json
│ │ ├── on-finished
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── on-headers
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── parseurl
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── path-to-regexp
│ │ │ ├── History.md
│ │ │ ├── LICENSE
│ │ │ ├── Readme.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── proxy-addr
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── qs
│ │ │ ├── .editorconfig
│ │ │ ├── .eslintignore
│ │ │ ├── .eslintrc
│ │ │ ├── .github
│ │ │ │ └── FUNDING.yml
│ │ │ ├── CHANGELOG.md
│ │ │ ├── LICENSE.md
│ │ │ ├── README.md
│ │ │ ├── dist
│ │ │ │ └── qs.js
│ │ │ ├── lib
│ │ │ │ ├── formats.js
│ │ │ │ ├── index.js
│ │ │ │ ├── parse.js
│ │ │ │ ├── stringify.js
│ │ │ │ └── utils.js
│ │ │ ├── package.json
│ │ │ └── test
│ │ │ │ ├── .eslintrc
│ │ │ │ ├── index.js
│ │ │ │ ├── parse.js
│ │ │ │ ├── stringify.js
│ │ │ │ └── utils.js
│ │ ├── random-bytes
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── range-parser
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── raw-body
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.d.ts
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── safe-buffer
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.d.ts
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── safer-buffer
│ │ │ ├── LICENSE
│ │ │ ├── Porting-Buffer.md
│ │ │ ├── Readme.md
│ │ │ ├── dangerous.js
│ │ │ ├── package.json
│ │ │ ├── safer.js
│ │ │ └── tests.js
│ │ ├── send
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ ├── node_modules
│ │ │ │ └── ms
│ │ │ │ │ ├── index.js
│ │ │ │ │ ├── license.md
│ │ │ │ │ ├── package.json
│ │ │ │ │ └── readme.md
│ │ │ └── package.json
│ │ ├── serve-static
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── setprototypeof
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.d.ts
│ │ │ ├── index.js
│ │ │ ├── package.json
│ │ │ └── test
│ │ │ │ └── index.js
│ │ ├── statuses
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── codes.json
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── toidentifier
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── type-is
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── uid-safe
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── unpipe
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ ├── utils-merge
│ │ │ ├── .npmignore
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ │ └── vary
│ │ │ ├── HISTORY.md
│ │ │ ├── LICENSE
│ │ │ ├── README.md
│ │ │ ├── index.js
│ │ │ └── package.json
│ ├── package-lock.json
│ ├── package.json
│ ├── routes
│ │ ├── customer.js
│ │ ├── department.js
│ │ ├── job.js
│ │ ├── user.js
│ │ └── visit.js
│ ├── server.js
│ └── utils
│ │ ├── promiseFS.js
│ │ └── tools.js
│ ├── example.md
│ ├── package.json
│ ├── server1.js
│ ├── server2.js
│ ├── src
│ ├── index.html
│ └── index.js
│ ├── webpack.config.js
│ ├── yarn.lock
│ ├── 在线精品框架课大纲,10.15晚开班(原价4600,前50人3200).png
│ ├── 珠峰系列公开课-前端开发中的跨域解决方案.pptx
│ └── 笔记.md
├── ##koa2-note##
└── koa2-note
│ ├── .gitignore
│ ├── LICENSE
│ ├── README.md
│ ├── SUMMARY.md
│ ├── demo
│ ├── cookie
│ │ ├── index.js
│ │ └── package.json
│ ├── ejs
│ │ ├── index.js
│ │ ├── package.json
│ │ └── view
│ │ │ └── index.ejs
│ ├── esm
│ │ ├── custom-loader.mjs
│ │ ├── index.js
│ │ ├── lib
│ │ │ ├── data.json
│ │ │ ├── path.js
│ │ │ └── render.js
│ │ ├── package.json
│ │ └── view
│ │ │ ├── helloworld.html
│ │ │ ├── index.html
│ │ │ └── todo.html
│ ├── jsonp-use-middleware
│ │ ├── index.js
│ │ └── package.json
│ ├── jsonp
│ │ ├── index.js
│ │ └── package.json
│ ├── mysql
│ │ ├── index.js
│ │ ├── package.json
│ │ ├── sql
│ │ │ ├── data.sql
│ │ │ └── user.sql
│ │ └── util
│ │ │ ├── db.js
│ │ │ ├── get-sql-content-map.js
│ │ │ ├── get-sql-map.js
│ │ │ └── walk-file.js
│ ├── project
│ │ ├── .editorconfig
│ │ ├── .gitignore
│ │ ├── config.js
│ │ ├── init
│ │ │ ├── index.js
│ │ │ ├── sql
│ │ │ │ └── user_info.sql
│ │ │ └── util
│ │ │ │ ├── db.js
│ │ │ │ ├── get-sql-content-map.js
│ │ │ │ ├── get-sql-map.js
│ │ │ │ └── walk-file.js
│ │ ├── package.json
│ │ ├── server
│ │ │ ├── app.js
│ │ │ ├── codes
│ │ │ │ └── user.js
│ │ │ ├── controllers
│ │ │ │ ├── admin.js
│ │ │ │ ├── index.js
│ │ │ │ ├── user-info.js
│ │ │ │ └── work.js
│ │ │ ├── models
│ │ │ │ └── user-info.js
│ │ │ ├── routers
│ │ │ │ ├── admin.js
│ │ │ │ ├── api.js
│ │ │ │ ├── error.js
│ │ │ │ ├── home.js
│ │ │ │ ├── index.js
│ │ │ │ └── work.js
│ │ │ ├── services
│ │ │ │ └── user-info.js
│ │ │ ├── utils
│ │ │ │ ├── datetime.js
│ │ │ │ ├── db-util.js
│ │ │ │ ├── type.js
│ │ │ │ └── upload.js
│ │ │ └── views
│ │ │ │ ├── admin.ejs
│ │ │ │ ├── error.ejs
│ │ │ │ ├── index.ejs
│ │ │ │ └── work.ejs
│ │ └── static
│ │ │ ├── build
│ │ │ ├── babel.config.js
│ │ │ ├── webpack.base.config.js
│ │ │ ├── webpack.dev.config.js
│ │ │ └── webpack.prod.config.js
│ │ │ ├── output
│ │ │ └── asset
│ │ │ │ └── image
│ │ │ │ └── deepsea-logo.jpg
│ │ │ └── src
│ │ │ ├── api
│ │ │ ├── sign-in.js
│ │ │ └── sign-up.js
│ │ │ ├── apps
│ │ │ ├── admin.jsx
│ │ │ ├── error.jsx
│ │ │ ├── index.jsx
│ │ │ └── work.jsx
│ │ │ ├── components
│ │ │ ├── footer-common.jsx
│ │ │ ├── form-group.jsx
│ │ │ ├── header-nav.jsx
│ │ │ ├── sign-in-form.jsx
│ │ │ └── sign-up-form.jsx
│ │ │ ├── css
│ │ │ └── index.less
│ │ │ ├── pages
│ │ │ ├── admin.js
│ │ │ ├── error.js
│ │ │ ├── index.js
│ │ │ └── work.js
│ │ │ ├── texts
│ │ │ ├── common.js
│ │ │ └── user-text.js
│ │ │ └── utils
│ │ │ ├── datetime.js
│ │ │ ├── request.js
│ │ │ ├── tool.js
│ │ │ └── upload.js
│ ├── request
│ │ ├── get.js
│ │ ├── package.json
│ │ ├── post-middleware.js
│ │ └── post.js
│ ├── route-simple
│ │ ├── index.js
│ │ ├── package.json
│ │ └── view
│ │ │ ├── 404.html
│ │ │ ├── index.html
│ │ │ └── todo.html
│ ├── route-use-middleware
│ │ ├── index.js
│ │ ├── package.json
│ │ ├── quick.js
│ │ └── routers
│ │ │ ├── api.js
│ │ │ ├── home.js
│ │ │ ├── index.js
│ │ │ └── page.js
│ ├── session
│ │ ├── index.js
│ │ └── package.json
│ ├── start-async
│ │ ├── index.js
│ │ ├── package.json
│ │ ├── util
│ │ │ └── render.js
│ │ └── view
│ │ │ └── index.html
│ ├── start-quick
│ │ ├── index.js
│ │ └── package.json
│ ├── static-server
│ │ ├── index.js
│ │ ├── package.json
│ │ ├── static
│ │ │ ├── css
│ │ │ │ └── style.css
│ │ │ ├── image
│ │ │ │ └── nodejs.jpg
│ │ │ ├── index.html
│ │ │ └── js
│ │ │ │ └── index.js
│ │ └── util
│ │ │ ├── content.js
│ │ │ ├── dir.js
│ │ │ ├── file.js
│ │ │ ├── mimes.js
│ │ │ └── walk.js
│ ├── static-use-middleware
│ │ ├── package.json
│ │ ├── src
│ │ │ └── index.js
│ │ ├── static
│ │ │ ├── css
│ │ │ │ └── style.css
│ │ │ ├── image
│ │ │ │ └── nodejs.jpg
│ │ │ ├── index.html
│ │ │ └── js
│ │ │ │ └── index.js
│ │ └── yarn.lock
│ ├── test-unit
│ │ ├── index.js
│ │ ├── package.json
│ │ └── test
│ │ │ └── index.test.js
│ ├── upload-async
│ │ ├── index.js
│ │ ├── package.json
│ │ ├── static
│ │ │ └── js
│ │ │ │ └── index.js
│ │ ├── util
│ │ │ └── upload.js
│ │ └── view
│ │ │ └── index.ejs
│ └── upload
│ │ ├── index.js
│ │ ├── package.json
│ │ └── util
│ │ └── upload.js
│ └── note
│ ├── cookie
│ └── info.md
│ ├── debug
│ └── info.md
│ ├── images
│ ├── async.png
│ ├── cookie-result-01.png
│ ├── debug-result-001.png
│ ├── debug-result-002.png
│ ├── debug-result-003.png
│ ├── debug-result-004.png
│ ├── debug-result-005.png
│ ├── debug-result-006.png
│ ├── debug-result-007.png
│ ├── debug-result-008.png
│ ├── jsonp-result-01.png
│ ├── jsonp-result-02.png
│ ├── jsonp-wiki.png
│ ├── mysql-init-result-01.png
│ ├── mysql-init-result-02.png
│ ├── project-result-00.png
│ ├── project-result-01.png
│ ├── project-result-02.png
│ ├── project-result-03.png
│ ├── request-get.png
│ ├── request-post-form.png
│ ├── request-post-result.png
│ ├── route-result-01.png
│ ├── session-result-01.png
│ ├── session-result-02.png
│ ├── session-result-03.png
│ ├── start-result-01.png
│ ├── static-server-result-01.png
│ ├── static-server-result-02.png
│ ├── static-server-result-03.png
│ ├── test-unit-result-01.png
│ ├── test-unit-result-02.png
│ ├── test-unit-result-03.png
│ ├── upload-async-result-01.png
│ ├── upload-simple-result-01.png
│ ├── upload-simple-result-02.png
│ ├── upload-simple-result-03.png
│ └── upload-simple-result-04.png
│ ├── jsonp
│ ├── info.md
│ └── koa-jsonp.md
│ ├── mysql
│ ├── async.md
│ ├── info.md
│ └── init.md
│ ├── other
│ └── esm.md
│ ├── project
│ ├── framework.md
│ ├── layer.md
│ ├── react.md
│ ├── route.md
│ ├── session.md
│ ├── sign.md
│ ├── sql.md
│ ├── start.md
│ └── webpack4.md
│ ├── request
│ ├── get.md
│ ├── post-use-middleware.md
│ └── post.md
│ ├── route
│ ├── koa-router.md
│ └── simple.md
│ ├── session
│ └── info.md
│ ├── start
│ ├── async.md
│ ├── info.md
│ ├── koa-async.md
│ ├── middleware.md
│ └── quick.md
│ ├── static
│ ├── middleware.md
│ └── server.md
│ ├── template
│ ├── add.md
│ └── ejs.md
│ ├── test
│ └── unit.md
│ └── upload
│ ├── busboy.md
│ ├── pic-async.md
│ └── simple.md
├── ##webpack##
├── webpack4.md
└── wepack-keypoint.md
├── #js#
├── ES6(92集之前).md
├── ES6(92集之后).md
└── js常用小技巧.md
├── #linux-note#
└── .黑马程序员 linux从入门到精通配套笔记.docx
├── README.md
├── books
├── 你不知道的JavaScript(上卷).pdf
├── 你不知道的JavaScript(下卷).pdf
├── 你不知道的JavaScript(中卷).pdf
├── 函数式编程.pdf
└── 函数式编程
│ ├── .gitignore
│ ├── LICENSE.md
│ ├── README.md
│ ├── SUMMARY.md
│ ├── ch1.md
│ ├── ch10.md
│ ├── ch11.md
│ ├── ch2.md
│ ├── ch3.md
│ ├── ch4.md
│ ├── ch5.md
│ ├── ch6.md
│ ├── ch7.md
│ ├── ch8.md
│ ├── ch9.md
│ ├── code
│ ├── lib
│ │ └── package.json
│ ├── part1_demo
│ │ ├── flickr.html
│ │ └── flickr.js
│ ├── part1_exercises
│ │ ├── README.md
│ │ ├── answers
│ │ │ ├── compose
│ │ │ │ ├── compose_exercises.js
│ │ │ │ └── compose_exercises_spec.js
│ │ │ └── curry
│ │ │ │ ├── curry_exercises.js
│ │ │ │ └── curry_exercises_spec.js
│ │ ├── exercises
│ │ │ ├── compose
│ │ │ │ ├── compose_exercises.js
│ │ │ │ └── compose_exercises_spec.js
│ │ │ └── curry
│ │ │ │ ├── curry_exercises.js
│ │ │ │ └── curry_exercises_spec.js
│ │ ├── package.json
│ │ └── support.js
│ └── part2_exercises
│ │ ├── README.md
│ │ ├── answers
│ │ ├── applicative
│ │ │ ├── applicative_exercises.js
│ │ │ └── applicative_exercises_spec.js
│ │ ├── functors
│ │ │ ├── functor_exercises.js
│ │ │ └── functor_exercises_spec.js
│ │ └── monads
│ │ │ ├── monad_exercises.js
│ │ │ └── monad_exercises_spec.js
│ │ ├── exercises
│ │ ├── applicative
│ │ │ ├── applicative_exercises.js
│ │ │ └── applicative_exercises_spec.js
│ │ ├── functors
│ │ │ ├── functor_exercises.js
│ │ │ └── functor_exercises_spec.js
│ │ └── monads
│ │ │ ├── monad_exercises.js
│ │ │ └── monad_exercises_spec.js
│ │ ├── package.json
│ │ └── support.js
│ └── images
│ ├── canopener.jpg
│ ├── cat.png
│ ├── cat_comp1.png
│ ├── cat_comp2.png
│ ├── cat_theory.png
│ ├── catmap copy.png
│ ├── catmap.png
│ ├── cats_ss.png
│ ├── chain.jpg
│ ├── console_ss.png
│ ├── cover.png
│ ├── dominoes.jpg
│ ├── fists.jpg
│ ├── fn_graph.png
│ ├── function-sets.gif
│ ├── functormap.png
│ ├── functormapmaybe.png
│ ├── jar.jpg
│ ├── monad_associativity.png
│ ├── natural_transformation.png
│ ├── onion.png
│ ├── plugs.jpg
│ ├── relation-not-function.gif
│ ├── ship_in_a_bottle.jpg
│ └── triangle_identity.png
├── electron
└── electron.md
├── git
└── README.md
├── node
├── node.md
└── nodeByjsliang.md
├── react
├── 01.react-basic.md
├── 02.react-advance.md
├── 03.Hook.md
├── 04.redux.md
├── 05.redux-saga.md
├── 06.React源码学习-createElment.md
├── 07.React源码学习-Component.md
├── 08.React源码学习-FiberRoot与Fiber.md
├── 09.React源码学习-update.md
├── 10.React源码学习-expirationTime.md
├── 11.React源码学习-任务调度.md
├── 12.React源码学习-beginWork.md
├── 13.React源码学习-commit.md
├── README.md
└── react-tuts
│ ├── immutable
│ ├── .gitignore
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ └── manifest.json
│ └── src
│ │ ├── App.js
│ │ ├── actions
│ │ └── counter.js
│ │ ├── components
│ │ ├── CounterBtn
│ │ │ └── index.js
│ │ ├── CounterDisplay
│ │ │ └── index.js
│ │ └── index.js
│ │ ├── index.js
│ │ ├── reducers
│ │ ├── counter.js
│ │ └── index.js
│ │ └── store.js
│ ├── lesson-01
│ ├── .gitignore
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ └── manifest.json
│ └── src
│ │ └── index.js
│ ├── lesson-02
│ ├── .gitignore
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ └── manifest.json
│ └── src
│ │ └── index.js
│ ├── lesson-03
│ ├── .gitignore
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ └── manifest.json
│ └── src
│ │ └── index.js
│ ├── lesson-04
│ ├── .gitignore
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ └── manifest.json
│ └── src
│ │ ├── index.css
│ │ └── index.js
│ ├── lesson-05
│ ├── .gitignore
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ └── manifest.json
│ └── src
│ │ ├── App.js
│ │ ├── components
│ │ ├── TodoHeader
│ │ │ └── index.js
│ │ ├── TodoInput
│ │ │ └── index.js
│ │ ├── TodoList
│ │ │ ├── TodoItem.js
│ │ │ └── index.js
│ │ └── index.js
│ │ └── index.js
│ ├── lesson-06
│ ├── .gitignore
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ └── manifest.json
│ └── src
│ │ ├── App.js
│ │ ├── components
│ │ ├── Like
│ │ │ └── index.js
│ │ ├── TodoHeader
│ │ │ └── index.js
│ │ ├── TodoInput
│ │ │ └── index.js
│ │ ├── TodoList
│ │ │ ├── TodoItem.js
│ │ │ └── index.js
│ │ └── index.js
│ │ └── index.js
│ ├── lesson-07
│ ├── .gitignore
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ └── manifest.json
│ └── src
│ │ ├── App.js
│ │ ├── components
│ │ ├── Like
│ │ │ └── index.js
│ │ ├── TodoHeader
│ │ │ └── index.js
│ │ ├── TodoInput
│ │ │ └── index.js
│ │ ├── TodoList
│ │ │ ├── TodoItem.js
│ │ │ └── index.js
│ │ └── index.js
│ │ └── index.js
│ ├── lesson-08
│ ├── .gitignore
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ └── manifest.json
│ └── src
│ │ ├── App.js
│ │ ├── components
│ │ ├── Like
│ │ │ └── index.js
│ │ ├── TodoHeader
│ │ │ └── index.js
│ │ ├── TodoInput
│ │ │ └── index.js
│ │ ├── TodoList
│ │ │ ├── TodoItem.js
│ │ │ └── index.js
│ │ └── index.js
│ │ ├── index.js
│ │ └── services
│ │ ├── apis.js
│ │ └── index.js
│ ├── lesson-09
│ ├── .gitignore
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ └── manifest.json
│ └── src
│ │ └── index.js
│ ├── lesson-10
│ ├── .gitignore
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ └── manifest.json
│ └── src
│ │ ├── App.js
│ │ ├── components
│ │ ├── CountBtn
│ │ │ └── index.js
│ │ ├── Counter
│ │ │ └── index.js
│ │ └── index.js
│ │ ├── counterStore.js
│ │ ├── index.bak.js
│ │ └── index.js
│ ├── lesson-11
│ ├── .gitignore
│ ├── README.md
│ ├── config-overrides.js
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ └── manifest.json
│ └── src
│ │ ├── Another.js
│ │ ├── App.js
│ │ ├── index.js
│ │ └── withCopyright.js
│ ├── lesson-12
│ ├── .gitignore
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ └── manifest.json
│ └── src
│ │ ├── App.js
│ │ ├── actions
│ │ ├── actionType.js
│ │ └── cart.js
│ │ ├── components
│ │ ├── CartList
│ │ │ └── index.js
│ │ └── index.js
│ │ ├── index.js
│ │ ├── reducers
│ │ ├── cart.js
│ │ └── index.js
│ │ └── store.js
│ ├── lesson-13
│ ├── .gitignore
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ └── manifest.json
│ └── src
│ │ ├── App.js
│ │ ├── actions
│ │ ├── actionType.js
│ │ └── cart.js
│ │ ├── components
│ │ ├── CartList
│ │ │ └── index.js
│ │ └── index.js
│ │ ├── index.js
│ │ ├── reducers
│ │ ├── cart.js
│ │ └── index.js
│ │ └── store.js
│ ├── lesson-14
│ ├── .gitignore
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ └── manifest.json
│ └── src
│ │ ├── App.js
│ │ ├── actions
│ │ ├── actionType.js
│ │ └── cart.js
│ │ ├── components
│ │ ├── CartList
│ │ │ └── index.js
│ │ └── index.js
│ │ ├── index.js
│ │ ├── reducers
│ │ ├── cart.js
│ │ └── index.js
│ │ └── store.js
│ ├── lesson-15
│ ├── .gitignore
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ └── manifest.json
│ └── src
│ │ ├── App.js
│ │ ├── actions
│ │ ├── actionTypes.js
│ │ └── blog.js
│ │ ├── components
│ │ ├── BlogList
│ │ │ ├── BlogItem.js
│ │ │ └── BlogList.js
│ │ └── index.js
│ │ ├── index.js
│ │ ├── reducers
│ │ ├── blog.js
│ │ └── index.js
│ │ ├── services
│ │ └── index.js
│ │ └── store.js
│ ├── lesson-16
│ ├── .gitignore
│ ├── README.md
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ └── manifest.json
│ └── src
│ │ ├── App.js
│ │ ├── components
│ │ ├── BackHome
│ │ │ └── index.js
│ │ └── index.js
│ │ ├── index.js
│ │ └── views
│ │ ├── Artical
│ │ ├── ArticalDetail.js
│ │ └── index.js
│ │ ├── Home
│ │ └── index.js
│ │ ├── NotFound
│ │ └── index.js
│ │ ├── Users
│ │ └── index.js
│ │ └── index.js
│ ├── lesson-17
│ ├── .gitignore
│ ├── README.md
│ ├── config-overrides.js
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ └── manifest.json
│ ├── src
│ │ ├── App.js
│ │ └── index.js
│ └── theme.js
│ ├── mobx
│ ├── .gitignore
│ ├── README.md
│ ├── config-overrides.js
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ │ ├── favicon.ico
│ │ ├── index.html
│ │ └── manifest.json
│ └── src
│ │ ├── App.js
│ │ ├── components
│ │ ├── CounterBtn
│ │ │ └── index.js
│ │ ├── CounterDisplay
│ │ │ └── index.js
│ │ └── index.js
│ │ ├── index.js
│ │ └── store
│ │ └── index.js
│ └── react-admin
│ ├── .gitignore
│ ├── README.md
│ ├── config-overrides.js
│ ├── lessVars.js
│ ├── package-lock.json
│ ├── package.json
│ ├── public
│ ├── favicon.ico
│ ├── index.html
│ └── manifest.json
│ ├── src
│ ├── App.js
│ ├── actions
│ │ ├── actionTypes.js
│ │ ├── notifications.js
│ │ └── user.js
│ ├── components
│ │ ├── Frame
│ │ │ ├── frame.less
│ │ │ ├── index.js
│ │ │ └── logo.png
│ │ ├── Loading
│ │ │ └── index.js
│ │ └── index.js
│ ├── index.js
│ ├── index.less
│ ├── reducers
│ │ ├── index.js
│ │ ├── notifications.js
│ │ └── user.js
│ ├── requests
│ │ └── index.js
│ ├── routes
│ │ └── index.js
│ ├── store.js
│ └── views
│ │ ├── Article
│ │ ├── Edit.js
│ │ ├── edit.less
│ │ └── index.js
│ │ ├── Dashboard
│ │ ├── dashboard.less
│ │ └── index.js
│ │ ├── Login
│ │ ├── index.js
│ │ └── login.less
│ │ ├── NoAuth
│ │ └── index.js
│ │ ├── NotFound
│ │ └── index.js
│ │ ├── Notifications
│ │ └── index.js
│ │ ├── Profile
│ │ └── index.js
│ │ ├── Settings
│ │ └── index.js
│ │ ├── index.js
│ │ └── loadable.js
│ └── yarn.lock
├── shareByothers
├── FE
│ ├── README.md
│ ├── snakeBorder.html
│ ├── 网络协议.md
│ └── 重绘与回流.md
├── README.md
├── assets
│ ├── README.md
│ └── img
│ │ ├── browerRender.png
│ │ ├── event.png
│ │ ├── js.jpg
│ │ ├── prototype.jpg
│ │ ├── react.jpg
│ │ ├── reactLifecycle.png
│ │ ├── react_sc
│ │ ├── FiberEl.png
│ │ ├── FiberTree.jpg
│ │ ├── createEl_babel.png
│ │ └── fiber-scheduler.png
│ │ ├── redux.jpg
│ │ ├── task.jpg
│ │ └── xieyi.jpg
├── books
│ ├── 你不知道的JavaScript(上卷).pdf
│ ├── 你不知道的JavaScript(下卷).pdf
│ └── 你不知道的JavaScript(中卷).pdf
├── git
│ └── README.md
├── js
│ ├── README.md
│ ├── call,apply与bind.md
│ ├── eval和with欺骗词法作用域影响性能.md
│ ├── new运算符.md
│ ├── 宏任务与微任务.md
│ ├── 排序算法.md
│ └── 构造函数和原型.md
├── js常用小技巧.md
├── react
│ ├── 01.react-basic.md
│ ├── 02.react-advance.md
│ ├── 03.Hook.md
│ ├── 04.redux.md
│ ├── 05.redux-saga.md
│ ├── 06.React源码学习-createElment.md
│ ├── 07.React源码学习-Component.md
│ ├── 08.React源码学习-FiberRoot与Fiber.md
│ ├── 09.React源码学习-update.md
│ ├── 10.React源码学习-expirationTime.md
│ ├── 11.React源码学习-任务调度.md
│ ├── 12.React源码学习-beginWork.md
│ ├── 13.React源码学习-commit.md
│ └── README.md
└── webpack4.md
├── ts
└── ts-axios
│ ├── ts-axios-doc-master
│ ├── .gitignore
│ ├── README.md
│ ├── deploy.js
│ ├── docs
│ │ ├── .vuepress
│ │ │ ├── config.js
│ │ │ └── public
│ │ │ │ ├── interceptor.png
│ │ │ │ ├── ts-logo.png
│ │ │ │ └── xsrf.png
│ │ ├── README.md
│ │ ├── chapter1
│ │ │ ├── README.md
│ │ │ ├── install.md
│ │ │ └── start.md
│ │ ├── chapter10
│ │ │ ├── auth.md
│ │ │ ├── baseURL.md
│ │ │ ├── paramsSerializer.md
│ │ │ ├── static.md
│ │ │ ├── upload-download.md
│ │ │ ├── validateStatus.md
│ │ │ ├── withCredentials.md
│ │ │ └── xsrf.md
│ │ ├── chapter11
│ │ │ ├── cancel.md
│ │ │ ├── headers.md
│ │ │ ├── helpers.md
│ │ │ ├── instance.md
│ │ │ ├── interceptor.md
│ │ │ ├── jest.md
│ │ │ ├── mergeConfig.md
│ │ │ ├── more.md
│ │ │ ├── preface.md
│ │ │ └── requests.md
│ │ ├── chapter12
│ │ │ ├── build-deploy.md
│ │ │ └── demo.md
│ │ ├── chapter13
│ │ │ └── summary.md
│ │ ├── chapter2
│ │ │ ├── advance.md
│ │ │ ├── class.md
│ │ │ ├── declare.md
│ │ │ ├── function.md
│ │ │ ├── generic.md
│ │ │ ├── inference.md
│ │ │ ├── interface.md
│ │ │ └── type.md
│ │ ├── chapter3
│ │ │ ├── base.md
│ │ │ ├── init.md
│ │ │ └── require.md
│ │ ├── chapter4
│ │ │ ├── data.md
│ │ │ ├── header.md
│ │ │ ├── response-data.md
│ │ │ ├── response-header.md
│ │ │ ├── response.md
│ │ │ └── url.md
│ │ ├── chapter5
│ │ │ ├── enhance.md
│ │ │ └── error.md
│ │ ├── chapter6
│ │ │ ├── extend.md
│ │ │ ├── generic.md
│ │ │ └── overload.md
│ │ ├── chapter7
│ │ │ └── interceptor.md
│ │ ├── chapter8
│ │ │ ├── create.md
│ │ │ ├── merge.md
│ │ │ └── transform.md
│ │ └── chapter9
│ │ │ └── cancel.md
│ ├── examples
│ │ ├── section1
│ │ │ ├── index.js
│ │ │ └── index.ts
│ │ ├── section2
│ │ │ ├── index.js
│ │ │ └── index.ts
│ │ ├── section3
│ │ │ ├── index.js
│ │ │ └── index.ts
│ │ ├── section4
│ │ │ ├── index.js
│ │ │ └── index.ts
│ │ ├── section5
│ │ │ ├── index.js
│ │ │ └── index.ts
│ │ ├── section6
│ │ │ ├── index.js
│ │ │ └── index.ts
│ │ ├── section7
│ │ │ ├── index.js
│ │ │ └── index.ts
│ │ └── section8
│ │ │ ├── index.js
│ │ │ └── index.ts
│ ├── package-lock.json
│ ├── package.json
│ └── yarn.lock
│ └── typescript-axios-master
│ ├── .editorconfig
│ ├── .gitignore
│ ├── .travis.yml
│ ├── CONTRIBUTING.md
│ ├── LICENSE
│ ├── README.md
│ ├── code-of-conduct.md
│ ├── examples
│ ├── base
│ │ ├── app.ts
│ │ └── index.html
│ ├── error
│ │ ├── app.ts
│ │ └── index.html
│ ├── extend
│ │ ├── app.ts
│ │ └── index.html
│ ├── global.css
│ ├── index.html
│ ├── server.js
│ ├── simple
│ │ ├── app.ts
│ │ └── index.html
│ └── webpack.config.js
│ ├── package-lock.json
│ ├── package.json
│ ├── rollup.config.ts
│ ├── src
│ ├── axios.ts
│ ├── core
│ │ ├── Axios.ts
│ │ ├── dispatchRequest.ts
│ │ └── xhr.ts
│ ├── helper
│ │ ├── data.ts
│ │ ├── error.ts
│ │ ├── headers.ts
│ │ ├── url.ts
│ │ └── util.ts
│ ├── index.ts
│ └── types
│ │ └── index.ts
│ ├── test.js
│ ├── test
│ └── typescript-axios.test.ts
│ ├── tools
│ ├── gh-pages-publish.ts
│ └── semantic-release-prepare.ts
│ ├── tsconfig.json
│ ├── tslint.json
│ └── yarn.lock
└── 设计模式
├── test.js
└── 设计模式.md
/##front高级##/跨域/讲义课件/CORS/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 珠峰培训 - 微信:18310612838
9 |
10 |
11 |
12 |
13 |
14 |
15 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/JSONP.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##front高级##/跨域/讲义课件/JSONP.png
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/JSONP/1.jsonp.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 珠峰培训 - 微信:18310612838
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/JSONP/1.jsonp.js:
--------------------------------------------------------------------------------
1 | $.ajax({
2 | url: 'http://127.0.0.1:8001/list',
3 | method: 'get',
4 | dataType: 'jsonp', //=>执行的是JSONP的请求
5 | success: res => {
6 | console.log(res);
7 | }
8 | });
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/JSONP/serverJSONP.js:
--------------------------------------------------------------------------------
1 | let express = require('express'),
2 | app = express();
3 | app.listen(8001, _ => {
4 | console.log('OK!');
5 | });
6 | app.get('/list', (req, res) => {
7 | let {
8 | callback = Function.prototype
9 | } = req.query;
10 | let data = {
11 | code: 0,
12 | message: '珠峰培训'
13 | };
14 | res.send(`${callback}(${JSON.stringify(data)})`);
15 | });
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/MESSAGE/A.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 珠峰培训 - 微信:18310612838
9 |
10 |
11 |
12 |
13 |
14 |
15 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/MESSAGE/B.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 珠峰培训 - 微信:18310612838
9 |
10 |
11 |
12 |
13 |
14 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/NAME/B.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 珠峰培训 - 微信:18310612838
9 |
10 |
11 |
12 |
13 |
14 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/NAME/proxy.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 珠峰培训 - 微信:18310612838
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | //=>WEB服务端口号
3 | PORT: 3001,
4 |
5 | //=>CROS跨域相关信息
6 | CROS: {
7 | ALLOW_ORIGIN: 'http://127.0.0.1:5500',
8 | ALLOW_METHODS: 'PUT,POST,GET,DELETE,OPTIONS,HEAD',
9 | HEADERS: 'Content-Type,Content-Length,Authorization, Accept,X-Requested-With',
10 | CREDENTIALS: true
11 | },
12 |
13 | //=>SESSION存储相关信息
14 | SESSION: {
15 | secret: 'ZFPX',
16 | saveUninitialized: false,
17 | resave: false,
18 | cookie: {
19 | maxAge: 1000 * 60 * 60 * 24 * 30
20 | }
21 | }
22 | };
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/json/department.json:
--------------------------------------------------------------------------------
1 | [{
2 | "id": 1,
3 | "name": "总裁办",
4 | "desc": "公司最高组织机构层,负责公司全面运营管理",
5 | "time": 1568640222269,
6 | "state": 0
7 | }, {
8 | "id": 2,
9 | "name": "销售部",
10 | "desc": "公司业务销售管理部门,负责拓展渠道和维护客户",
11 | "time": 1568640222269,
12 | "state": 0
13 | }, {
14 | "id": 3,
15 | "name": "产品研发部",
16 | "desc": "公司产品研发部门,负责生产研发公司的产品",
17 | "time": 1568640222269,
18 | "state": 0
19 | }, {
20 | "id": 4,
21 | "name": "后勤部",
22 | "desc": "公司后勤管理部门,负责行政、财务、人事等日常管理工作",
23 | "time": 1568640222269,
24 | "state": 0
25 | }]
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/json/visit.json:
--------------------------------------------------------------------------------
1 | [{"id":1,"customerId":"6","visitText":"大叔大婶","visitTime":"2019-09-21","time":1568974134992,"state":1},{"id":2,"customerId":"6","visitText":"定位撒无撒所多","visitTime":"2019-09-21","time":1568974137608,"state":0}]
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/.bin/mime:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3 |
4 | case `uname` in
5 | *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
6 | esac
7 |
8 | if [ -x "$basedir/node" ]; then
9 | "$basedir/node" "$basedir/../mime/cli.js" "$@"
10 | ret=$?
11 | else
12 | node "$basedir/../mime/cli.js" "$@"
13 | ret=$?
14 | fi
15 | exit $ret
16 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/.bin/mime.cmd:
--------------------------------------------------------------------------------
1 | @IF EXIST "%~dp0\node.exe" (
2 | "%~dp0\node.exe" "%~dp0\..\mime\cli.js" %*
3 | ) ELSE (
4 | @SETLOCAL
5 | @SET PATHEXT=%PATHEXT:;.JS;=;%
6 | node "%~dp0\..\mime\cli.js" %*
7 | )
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/body-parser/node_modules/qs/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 4
6 | end_of_line = lf
7 | charset = utf-8
8 | trim_trailing_whitespace = true
9 | insert_final_newline = true
10 | max_line_length = 160
11 |
12 | [test/*]
13 | max_line_length = off
14 |
15 | [*.md]
16 | max_line_length = off
17 |
18 | [*.json]
19 | max_line_length = off
20 |
21 | [Makefile]
22 | max_line_length = off
23 |
24 | [CHANGELOG.md]
25 | indent_style = space
26 | indent_size = 2
27 |
28 | [LICENSE]
29 | indent_size = 2
30 | max_line_length = off
31 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/body-parser/node_modules/qs/.eslintignore:
--------------------------------------------------------------------------------
1 | dist
2 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/body-parser/node_modules/qs/lib/formats.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var replace = String.prototype.replace;
4 | var percentTwenties = /%20/g;
5 |
6 | module.exports = {
7 | 'default': 'RFC3986',
8 | formatters: {
9 | RFC1738: function (value) {
10 | return replace.call(value, percentTwenties, '+');
11 | },
12 | RFC3986: function (value) {
13 | return value;
14 | }
15 | },
16 | RFC1738: 'RFC1738',
17 | RFC3986: 'RFC3986'
18 | };
19 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/body-parser/node_modules/qs/lib/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var stringify = require('./stringify');
4 | var parse = require('./parse');
5 | var formats = require('./formats');
6 |
7 | module.exports = {
8 | formats: formats,
9 | parse: parse,
10 | stringify: stringify
11 | };
12 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/body-parser/node_modules/qs/test/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "rules": {
3 | "array-bracket-newline": 0,
4 | "array-element-newline": 0,
5 | "consistent-return": 2,
6 | "function-paren-newline": 0,
7 | "max-lines": 0,
8 | "max-lines-per-function": 0,
9 | "max-nested-callbacks": [2, 3],
10 | "max-statements": 0,
11 | "no-buffer-constructor": 0,
12 | "no-extend-native": 0,
13 | "no-magic-numbers": 0,
14 | "object-curly-newline": 0,
15 | "sort-keys": 0
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/body-parser/node_modules/qs/test/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | require('./parse');
4 |
5 | require('./stringify');
6 |
7 | require('./utils');
8 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/content-type/HISTORY.md:
--------------------------------------------------------------------------------
1 | 1.0.4 / 2017-09-11
2 | ==================
3 |
4 | * perf: skip parameter parsing when no parameters
5 |
6 | 1.0.3 / 2017-09-10
7 | ==================
8 |
9 | * perf: remove argument reassignment
10 |
11 | 1.0.2 / 2016-05-09
12 | ==================
13 |
14 | * perf: enable strict mode
15 |
16 | 1.0.1 / 2015-02-13
17 | ==================
18 |
19 | * Improve missing `Content-Type` header error message
20 |
21 | 1.0.0 / 2015-02-01
22 | ==================
23 |
24 | * Initial implementation, derived from `media-typer@0.3.0`
25 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/cookie-signature/.npmignore:
--------------------------------------------------------------------------------
1 | support
2 | test
3 | examples
4 | *.sock
5 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/debug/.coveralls.yml:
--------------------------------------------------------------------------------
1 | repo_token: SIAeZjKYlHK74rbcFvNHMUzjRiMpflxve
2 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/debug/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "browser": true,
4 | "node": true
5 | },
6 | "rules": {
7 | "no-console": 0,
8 | "no-empty": [1, { "allowEmptyCatch": true }]
9 | },
10 | "extends": "eslint:recommended"
11 | }
12 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/debug/.npmignore:
--------------------------------------------------------------------------------
1 | support
2 | test
3 | examples
4 | example
5 | *.sock
6 | dist
7 | yarn.lock
8 | coverage
9 | bower.json
10 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/debug/.travis.yml:
--------------------------------------------------------------------------------
1 |
2 | language: node_js
3 | node_js:
4 | - "6"
5 | - "5"
6 | - "4"
7 |
8 | install:
9 | - make node_modules
10 |
11 | script:
12 | - make lint
13 | - make test
14 | - make coveralls
15 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/debug/component.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "debug",
3 | "repo": "visionmedia/debug",
4 | "description": "small debugging utility",
5 | "version": "2.6.9",
6 | "keywords": [
7 | "debug",
8 | "log",
9 | "debugger"
10 | ],
11 | "main": "src/browser.js",
12 | "scripts": [
13 | "src/browser.js",
14 | "src/debug.js"
15 | ],
16 | "dependencies": {
17 | "rauchg/ms.js": "0.7.1"
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/debug/node.js:
--------------------------------------------------------------------------------
1 | module.exports = require('./src/node');
2 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/debug/src/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Detect Electron renderer process, which is node, but we should
3 | * treat as a browser.
4 | */
5 |
6 | if (typeof process !== 'undefined' && process.type === 'renderer') {
7 | module.exports = require('./browser.js');
8 | } else {
9 | module.exports = require('./node.js');
10 | }
11 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/debug/src/inspector-log.js:
--------------------------------------------------------------------------------
1 | module.exports = inspectorLog;
2 |
3 | // black hole
4 | const nullStream = new (require('stream').Writable)();
5 | nullStream._write = () => {};
6 |
7 | /**
8 | * Outputs a `console.log()` to the Node.js Inspector console *only*.
9 | */
10 | function inspectorLog() {
11 | const stdout = console._stdout;
12 | console._stdout = nullStream;
13 | console.log.apply(console, arguments);
14 | console._stdout = stdout;
15 | }
16 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/depd/lib/compat/event-listener-count.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * depd
3 | * Copyright(c) 2015 Douglas Christopher Wilson
4 | * MIT Licensed
5 | */
6 |
7 | 'use strict'
8 |
9 | /**
10 | * Module exports.
11 | * @public
12 | */
13 |
14 | module.exports = eventListenerCount
15 |
16 | /**
17 | * Get the count of listeners on an event emitter of a specific type.
18 | */
19 |
20 | function eventListenerCount (emitter, type) {
21 | return emitter.listeners(type).length
22 | }
23 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/encodeurl/HISTORY.md:
--------------------------------------------------------------------------------
1 | 1.0.2 / 2018-01-21
2 | ==================
3 |
4 | * Fix encoding `%` as last character
5 |
6 | 1.0.1 / 2016-06-09
7 | ==================
8 |
9 | * Fix encoding unpaired surrogates at start/end of string
10 |
11 | 1.0.0 / 2016-06-08
12 | ==================
13 |
14 | * Initial release
15 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/express/index.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * express
3 | * Copyright(c) 2009-2013 TJ Holowaychuk
4 | * Copyright(c) 2013 Roman Shtylman
5 | * Copyright(c) 2014-2015 Douglas Christopher Wilson
6 | * MIT Licensed
7 | */
8 |
9 | 'use strict';
10 |
11 | module.exports = require('./lib/express');
12 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/express/node_modules/qs/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 4
6 | end_of_line = lf
7 | charset = utf-8
8 | trim_trailing_whitespace = true
9 | insert_final_newline = true
10 | max_line_length = 160
11 |
12 | [test/*]
13 | max_line_length = off
14 |
15 | [*.md]
16 | max_line_length = off
17 |
18 | [*.json]
19 | max_line_length = off
20 |
21 | [Makefile]
22 | max_line_length = off
23 |
24 | [CHANGELOG.md]
25 | indent_style = space
26 | indent_size = 2
27 |
28 | [LICENSE]
29 | indent_size = 2
30 | max_line_length = off
31 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/express/node_modules/qs/.eslintignore:
--------------------------------------------------------------------------------
1 | dist
2 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/express/node_modules/qs/lib/formats.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var replace = String.prototype.replace;
4 | var percentTwenties = /%20/g;
5 |
6 | module.exports = {
7 | 'default': 'RFC3986',
8 | formatters: {
9 | RFC1738: function (value) {
10 | return replace.call(value, percentTwenties, '+');
11 | },
12 | RFC3986: function (value) {
13 | return value;
14 | }
15 | },
16 | RFC1738: 'RFC1738',
17 | RFC3986: 'RFC3986'
18 | };
19 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/express/node_modules/qs/lib/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var stringify = require('./stringify');
4 | var parse = require('./parse');
5 | var formats = require('./formats');
6 |
7 | module.exports = {
8 | formats: formats,
9 | parse: parse,
10 | stringify: stringify
11 | };
12 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/express/node_modules/qs/test/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "rules": {
3 | "array-bracket-newline": 0,
4 | "array-element-newline": 0,
5 | "consistent-return": 2,
6 | "function-paren-newline": 0,
7 | "max-lines": 0,
8 | "max-lines-per-function": 0,
9 | "max-nested-callbacks": [2, 3],
10 | "max-statements": 0,
11 | "no-buffer-constructor": 0,
12 | "no-extend-native": 0,
13 | "no-magic-numbers": 0,
14 | "object-curly-newline": 0,
15 | "sort-keys": 0
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/express/node_modules/qs/test/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | require('./parse');
4 |
5 | require('./stringify');
6 |
7 | require('./utils');
8 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/forwarded/HISTORY.md:
--------------------------------------------------------------------------------
1 | 0.1.2 / 2017-09-14
2 | ==================
3 |
4 | * perf: improve header parsing
5 | * perf: reduce overhead when no `X-Forwarded-For` header
6 |
7 | 0.1.1 / 2017-09-10
8 | ==================
9 |
10 | * Fix trimming leading / trailing OWS
11 | * perf: hoist regular expression
12 |
13 | 0.1.0 / 2014-09-21
14 | ==================
15 |
16 | * Initial release
17 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/inherits/inherits.js:
--------------------------------------------------------------------------------
1 | try {
2 | var util = require('util');
3 | if (typeof util.inherits !== 'function') throw '';
4 | module.exports = util.inherits;
5 | } catch (e) {
6 | module.exports = require('./inherits_browser.js');
7 | }
8 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/media-typer/HISTORY.md:
--------------------------------------------------------------------------------
1 | 0.3.0 / 2014-09-07
2 | ==================
3 |
4 | * Support Node.js 0.6
5 | * Throw error when parameter format invalid on parse
6 |
7 | 0.2.0 / 2014-06-18
8 | ==================
9 |
10 | * Add `typer.format()` to format media types
11 |
12 | 0.1.0 / 2014-06-17
13 | ==================
14 |
15 | * Accept `req` as argument to `parse`
16 | * Accept `res` as argument to `parse`
17 | * Parse media type with extra LWS between type and first parameter
18 |
19 | 0.0.0 / 2014-06-13
20 | ==================
21 |
22 | * Initial implementation
23 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/merge-descriptors/HISTORY.md:
--------------------------------------------------------------------------------
1 | 1.0.1 / 2016-01-17
2 | ==================
3 |
4 | * perf: enable strict mode
5 |
6 | 1.0.0 / 2015-03-01
7 | ==================
8 |
9 | * Add option to only add new descriptors
10 | * Add simple argument validation
11 | * Add jsdoc to source file
12 |
13 | 0.0.2 / 2013-12-14
14 | ==================
15 |
16 | * Move repository to `component` organization
17 |
18 | 0.0.1 / 2013-10-29
19 | ==================
20 |
21 | * Initial release
22 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/methods/HISTORY.md:
--------------------------------------------------------------------------------
1 | 1.1.2 / 2016-01-17
2 | ==================
3 |
4 | * perf: enable strict mode
5 |
6 | 1.1.1 / 2014-12-30
7 | ==================
8 |
9 | * Improve `browserify` support
10 |
11 | 1.1.0 / 2014-07-05
12 | ==================
13 |
14 | * Add `CONNECT` method
15 |
16 | 1.0.1 / 2014-06-02
17 | ==================
18 |
19 | * Fix module to work with harmony transform
20 |
21 | 1.0.0 / 2014-05-08
22 | ==================
23 |
24 | * Add `PURGE` method
25 |
26 | 0.1.0 / 2013-10-28
27 | ==================
28 |
29 | * Add `http.METHODS` support
30 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/mime-db/index.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * mime-db
3 | * Copyright(c) 2014 Jonathan Ong
4 | * MIT Licensed
5 | */
6 |
7 | /**
8 | * Module exports.
9 | */
10 |
11 | module.exports = require('./db.json')
12 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/mime/.npmignore:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##front高级##/跨域/讲义课件/OA系统后台/node_modules/mime/.npmignore
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/mime/cli.js:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env node
2 |
3 | var mime = require('./mime.js');
4 | var file = process.argv[2];
5 | var type = mime.lookup(file);
6 |
7 | process.stdout.write(type + '\n');
8 |
9 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/on-headers/HISTORY.md:
--------------------------------------------------------------------------------
1 | 1.0.2 / 2019-02-21
2 | ==================
3 |
4 | * Fix `res.writeHead` patch missing return value
5 |
6 | 1.0.1 / 2015-09-29
7 | ==================
8 |
9 | * perf: enable strict mode
10 |
11 | 1.0.0 / 2014-08-10
12 | ==================
13 |
14 | * Honor `res.statusCode` change in `listener`
15 | * Move to `jshttp` organization
16 | * Prevent `arguments`-related de-opt
17 |
18 | 0.0.0 / 2014-05-13
19 | ==================
20 |
21 | * Initial implementation
22 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/qs/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 |
3 | [*]
4 | indent_style = space
5 | indent_size = 4
6 | end_of_line = lf
7 | charset = utf-8
8 | trim_trailing_whitespace = true
9 | insert_final_newline = true
10 | max_line_length = 160
11 |
12 | [test/*]
13 | max_line_length = off
14 |
15 | [LICENSE.md]
16 | indent_size = off
17 |
18 | [*.md]
19 | max_line_length = off
20 |
21 | [*.json]
22 | max_line_length = off
23 |
24 | [Makefile]
25 | max_line_length = off
26 |
27 | [CHANGELOG.md]
28 | indent_style = space
29 | indent_size = 2
30 |
31 | [LICENSE]
32 | indent_size = 2
33 | max_line_length = off
34 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/qs/.eslintignore:
--------------------------------------------------------------------------------
1 | dist
2 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/qs/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "root": true,
3 |
4 | "extends": "@ljharb",
5 |
6 | "rules": {
7 | "complexity": 0,
8 | "consistent-return": 1,
9 | "func-name-matching": 0,
10 | "id-length": [2, { "min": 1, "max": 25, "properties": "never" }],
11 | "indent": [2, 4],
12 | "max-lines-per-function": [2, { "max": 150 }],
13 | "max-params": [2, 14],
14 | "max-statements": [2, 52],
15 | "multiline-comment-style": 0,
16 | "no-continue": 1,
17 | "no-magic-numbers": 0,
18 | "no-restricted-syntax": [2, "BreakStatement", "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"],
19 | "operator-linebreak": [2, "before"],
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/qs/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: [ljharb]
4 | patreon: # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: npm/qs
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | custom: # Replace with a single custom sponsorship URL
13 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/qs/lib/formats.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var replace = String.prototype.replace;
4 | var percentTwenties = /%20/g;
5 |
6 | var util = require('./utils');
7 |
8 | var Format = {
9 | RFC1738: 'RFC1738',
10 | RFC3986: 'RFC3986'
11 | };
12 |
13 | module.exports = util.assign(
14 | {
15 | 'default': Format.RFC3986,
16 | formatters: {
17 | RFC1738: function (value) {
18 | return replace.call(value, percentTwenties, '+');
19 | },
20 | RFC3986: function (value) {
21 | return String(value);
22 | }
23 | }
24 | },
25 | Format
26 | );
27 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/qs/lib/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | var stringify = require('./stringify');
4 | var parse = require('./parse');
5 | var formats = require('./formats');
6 |
7 | module.exports = {
8 | formats: formats,
9 | parse: parse,
10 | stringify: stringify
11 | };
12 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/qs/test/.eslintrc:
--------------------------------------------------------------------------------
1 | {
2 | "rules": {
3 | "array-bracket-newline": 0,
4 | "array-element-newline": 0,
5 | "consistent-return": 2,
6 | "function-paren-newline": 0,
7 | "max-lines": 0,
8 | "max-lines-per-function": 0,
9 | "max-nested-callbacks": [2, 3],
10 | "max-statements": 0,
11 | "no-buffer-constructor": 0,
12 | "no-extend-native": 0,
13 | "no-magic-numbers": 0,
14 | "object-curly-newline": 0,
15 | "sort-keys": 0
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/qs/test/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | require('./parse');
4 |
5 | require('./stringify');
6 |
7 | require('./utils');
8 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/random-bytes/HISTORY.md:
--------------------------------------------------------------------------------
1 | 1.0.0 / 2016-01-17
2 | ==================
3 |
4 | * Initial release
5 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/setprototypeof/index.d.ts:
--------------------------------------------------------------------------------
1 | declare function setPrototypeOf(o: any, proto: object | null): any;
2 | export = setPrototypeOf;
3 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/setprototypeof/index.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 | /* eslint no-proto: 0 */
3 | module.exports = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties)
4 |
5 | function setProtoOf (obj, proto) {
6 | obj.__proto__ = proto
7 | return obj
8 | }
9 |
10 | function mixinProperties (obj, proto) {
11 | for (var prop in proto) {
12 | if (!obj.hasOwnProperty(prop)) {
13 | obj[prop] = proto[prop]
14 | }
15 | }
16 | return obj
17 | }
18 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/toidentifier/index.js:
--------------------------------------------------------------------------------
1 | /*!
2 | * toidentifier
3 | * Copyright(c) 2016 Douglas Christopher Wilson
4 | * MIT Licensed
5 | */
6 |
7 | /**
8 | * Module exports.
9 | * @public
10 | */
11 |
12 | module.exports = toIdentifier
13 |
14 | /**
15 | * Trasform the given string into a JavaScript identifier
16 | *
17 | * @param {string} str
18 | * @returns {string}
19 | * @public
20 | */
21 |
22 | function toIdentifier (str) {
23 | return str
24 | .split(' ')
25 | .map(function (token) {
26 | return token.slice(0, 1).toUpperCase() + token.slice(1)
27 | })
28 | .join('')
29 | .replace(/[^ _0-9a-z]/gi, '')
30 | }
31 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/unpipe/HISTORY.md:
--------------------------------------------------------------------------------
1 | 1.0.0 / 2015-06-14
2 | ==================
3 |
4 | * Initial release
5 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/utils-merge/.npmignore:
--------------------------------------------------------------------------------
1 | CONTRIBUTING.md
2 | Makefile
3 | docs/
4 | examples/
5 | reports/
6 | test/
7 |
8 | .jshintrc
9 | .travis.yml
10 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/node_modules/utils-merge/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Merge object b with object a.
3 | *
4 | * var a = { foo: 'bar' }
5 | * , b = { bar: 'baz' };
6 | *
7 | * merge(a, b);
8 | * // => { foo: 'bar', bar: 'baz' }
9 | *
10 | * @param {Object} a
11 | * @param {Object} b
12 | * @return {Object}
13 | * @api public
14 | */
15 |
16 | exports = module.exports = function(a, b){
17 | if (a && b) {
18 | for (var key in b) {
19 | a[key] = b[key];
20 | }
21 | }
22 | return a;
23 | };
24 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/OA系统后台/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "admin",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "server.js",
6 | "scripts": {},
7 | "keywords": [],
8 | "author": "",
9 | "license": "ISC",
10 | "dependencies": {
11 | "body-parser": "^1.19.0",
12 | "express": "^4.17.1",
13 | "express-session": "^1.16.2",
14 | "qs": "^6.8.0"
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "20191014",
3 | "version": "1.0.0",
4 | "main": "index.js",
5 | "license": "MIT",
6 | "dependencies": {
7 | "axios": "^0.19.0",
8 | "body-parser": "^1.19.0",
9 | "express": "^4.17.1",
10 | "html-webpack-plugin": "^3.2.0",
11 | "jquery": "^3.4.1",
12 | "jsonp": "^0.2.1",
13 | "webpack": "^4.41.1",
14 | "webpack-cli": "^3.3.9",
15 | "webpack-dev-server": "^3.8.2"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/server1.js:
--------------------------------------------------------------------------------
1 | let express = require('express'),
2 | app = express();
3 | app.listen(1001, _ => {
4 | console.log('OK!');
5 | });
6 | app.use(express.static('./'));
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/server2.js:
--------------------------------------------------------------------------------
1 | let express = require('express'),
2 | app = express();
3 | app.listen(1002, _ => {
4 | console.log('OK!');
5 | });
6 | app.use(express.static('./'));
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 | 珠峰培训 - 微信:18310612838
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/src/index.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios';
2 |
3 | axios.get('/user/list').then(res => {
4 | console.log(res);
5 | });
6 |
7 | axios.post('/user/login');
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/webpack.config.js:
--------------------------------------------------------------------------------
1 | let path = require('path');
2 | let HtmlWebpackPlugin = require('html-webpack-plugin');
3 | module.exports = {
4 | mode: 'production',
5 | entry: './src/index.js',
6 | output: {
7 | filename: 'bundle.min.js',
8 | path: path.resolve(__dirname, 'build')
9 | },
10 | devServer: {
11 | port: 3000,
12 | progress: true,
13 | contentBase: './build',
14 | proxy: {
15 | '/': {
16 | target: 'http://127.0.0.1:3001',
17 | changeOrigin: true
18 | }
19 | }
20 | },
21 | plugins: [
22 | new HtmlWebpackPlugin({
23 | template: './src/index.html',
24 | filename: 'index.html'
25 | })
26 | ]
27 | };
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/在线精品框架课大纲,10.15晚开班(原价4600,前50人3200).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##front高级##/跨域/讲义课件/在线精品框架课大纲,10.15晚开班(原价4600,前50人3200).png
--------------------------------------------------------------------------------
/##front高级##/跨域/讲义课件/珠峰系列公开课-前端开发中的跨域解决方案.pptx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##front高级##/跨域/讲义课件/珠峰系列公开课-前端开发中的跨域解决方案.pptx
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | npm-debug.log
3 | _book/
4 | demo/*/node_modules
5 | demo/*/npm-debug.log
6 | demo/*/package-lock.json
7 | demo/*/upload-files/
8 | demo/upload-async/static/image/
9 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/cookie/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "cookie",
3 | "version": "1.0.0",
4 | "description": "koa cookie demo",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node index.js"
8 | },
9 | "keywords": [
10 | "koajs"
11 | ],
12 | "author": "chenshenhai",
13 | "license": "MIT",
14 | "dependencies": {
15 | "koa": "^2.3.0"
16 | },
17 | "engines": {
18 | "node": ">=7.6.0",
19 | "npm": ">=3.0.0"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/ejs/index.js:
--------------------------------------------------------------------------------
1 | const Koa = require('koa')
2 | const views = require('koa-views')
3 | const path = require('path')
4 | const app = new Koa()
5 |
6 | app.use(views(path.join(__dirname, './view'), {
7 | extension: 'ejs'
8 | }))
9 |
10 | app.use( async ( ctx ) => {
11 | let title = 'hello koa2'
12 | await ctx.render('index', {
13 | title,
14 | })
15 | })
16 |
17 | app.listen(3000, ()=>{
18 | console.log('[demo] ejs is starting at port 3000')
19 | })
20 |
21 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/ejs/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "ejs",
3 | "version": "1.0.0",
4 | "description": "koa ejs demo",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node index.js"
8 | },
9 | "keywords": [
10 | "koajs"
11 | ],
12 | "author": "chenshenhai",
13 | "license": "MIT",
14 | "dependencies": {
15 | "ejs": "^2.5.7",
16 | "koa": "^2.3.0",
17 | "koa-views": "^5.2.1"
18 | },
19 | "engines": {
20 | "node": ">=7.6.0",
21 | "npm": ">=3.0.0"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/ejs/view/index.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <%= title %>
5 |
6 |
7 | <%= title %>
8 | EJS Welcome to <%= title %>
9 |
10 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/esm/index.js:
--------------------------------------------------------------------------------
1 | import Koa from 'koa';
2 | import { render } from './lib/render.js';
3 | import data from './lib/data.json';
4 |
5 | let app = new Koa();
6 | app.use((ctx, next) => {
7 | let view = ctx.url.substr(1);
8 | let content;
9 | if ( view === '' ) {
10 | content = render('index');
11 | } else if ( view === 'data' ) {
12 | content = data;
13 | } else {
14 | content = render(view);
15 | }
16 | ctx.body = content;
17 | })
18 | app.listen(3000, ()=>{
19 | console.log('the modules test server is starting');
20 | })
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/esm/lib/data.json:
--------------------------------------------------------------------------------
1 | {
2 | "title": "hello ES6 Modules",
3 | "name": "ES6"
4 | }
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/esm/lib/path.js:
--------------------------------------------------------------------------------
1 | import process from 'process';
2 |
3 | export const PROJECT_PATH = process.cwd();
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/esm/lib/render.js:
--------------------------------------------------------------------------------
1 | import { PROJECT_PATH } from './path.js';
2 | import fs from 'fs';
3 | import path from 'path'
4 |
5 | export const render = ( view ) => {
6 | let viewPath = path.join(PROJECT_PATH, 'view',`${view}.html`);
7 | if ( fs.existsSync(viewPath) ) {
8 | return fs.readFileSync(viewPath, 'binary');
9 | } else {
10 | return `Error: file ${view}.html is not found!`;
11 | }
12 | }
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/esm/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "demo1",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node --experimental-modules --loader ./custom-loader.mjs ./index.js"
8 | },
9 | "author": "",
10 | "license": "MIT",
11 | "engines": {
12 | "node": ">= 9.0.0"
13 | },
14 | "dependencies": {
15 | "koa": "^2.4.1"
16 | },
17 | "devDependencies": {
18 | "eslint": "^4.11.0"
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/esm/view/helloworld.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | hello world
4 |
5 |
6 | hello world page
7 |
8 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/esm/view/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | index
4 |
5 |
6 | hello world
7 |
21 |
22 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/esm/view/todo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | todo
4 |
5 |
6 | todo page
7 |
8 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/jsonp-use-middleware/index.js:
--------------------------------------------------------------------------------
1 | const Koa = require('koa')
2 | const jsonp = require('koa-jsonp')
3 | const app = new Koa()
4 |
5 | // 使用中间件
6 | app.use(jsonp())
7 |
8 | app.use( async ( ctx ) => {
9 |
10 | let returnData = {
11 | success: true,
12 | data: {
13 | text: 'this is a jsonp api',
14 | time: new Date().getTime(),
15 | }
16 | }
17 |
18 | ctx.body = returnData
19 | })
20 |
21 | app.listen(3000, () => {
22 | console.log('[demo] jsonp is starting at port 3000')
23 | })
24 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/jsonp-use-middleware/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "start-quick",
3 | "version": "1.0.0",
4 | "description": "koa jsonp demo",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node index.js"
8 | },
9 | "keywords": [
10 | "koajs"
11 | ],
12 | "author": "chenshenhai",
13 | "license": "MIT",
14 | "dependencies": {
15 | "koa": "^2.3.0",
16 | "koa-jsonp": "^2.0.2"
17 | },
18 | "engines": {
19 | "node": ">=7.6.0",
20 | "npm": ">=3.0.0"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/jsonp/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "start-quick",
3 | "version": "1.0.0",
4 | "description": "koa jsonp demo",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node index.js"
8 | },
9 | "keywords": [
10 | "koajs"
11 | ],
12 | "author": "chenshenhai",
13 | "license": "MIT",
14 | "dependencies": {
15 | "koa": "^2.3.0"
16 | },
17 | "engines": {
18 | "node": ">=7.6.0",
19 | "npm": ">=3.0.0"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/mysql/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "mysql",
3 | "version": "1.0.0",
4 | "description": "koa start demo",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node index.js"
8 | },
9 | "keywords": [
10 | "koajs"
11 | ],
12 | "author": "chenshenhai",
13 | "license": "MIT",
14 | "dependencies": {
15 | "koa": "^2.0.1",
16 | "mysql": "^2.13.0"
17 | },
18 | "engines": {
19 | "node": ">=7.6.0",
20 | "npm": ">=3.0.0"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/mysql/sql/data.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE IF NOT EXISTS `data` (
2 | `id` int(11) NOT NULL AUTO_INCREMENT,
3 | `data_info` json DEFAULT NULL,
4 | `create_time` varchar(20) DEFAULT NULL,
5 | `modified_time` varchar(20) DEFAULT NULL,
6 | `level` int(11) DEFAULT NULL,
7 | PRIMARY KEY (`id`)
8 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8
9 |
10 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/mysql/sql/user.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE IF NOT EXISTS `user` (
2 | `id` int(11) NOT NULL AUTO_INCREMENT,
3 | `email` varchar(255) DEFAULT NULL,
4 | `password` varchar(255) DEFAULT NULL,
5 | `name` varchar(255) DEFAULT NULL,
6 | `nick` varchar(255) DEFAULT NULL,
7 | `detail_info` json DEFAULT NULL,
8 | `create_time` varchar(20) DEFAULT NULL,
9 | `modified_time` varchar(20) DEFAULT NULL,
10 | `level` int(11) DEFAULT NULL,
11 | PRIMARY KEY (`id`)
12 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
13 |
14 | INSERT INTO `user` set email='1@example.com', password='123456';
15 | INSERT INTO `user` set email='2@example.com', password='123456';
16 | INSERT INTO `user` set email='3@example.com', password='123456';
17 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/mysql/util/get-sql-content-map.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs')
2 | const getSqlMap = require('./get-sql-map')
3 |
4 | let sqlContentMap = {}
5 |
6 | /**
7 | * 读取sql文件内容
8 | * @param {string} fileName 文件名称
9 | * @param {string} path 文件所在的路径
10 | * @return {string} 脚本文件内容
11 | */
12 | function getSqlContent( fileName, path ) {
13 | let content = fs.readFileSync( path, 'utf8' )
14 | sqlContentMap[ fileName ] = content
15 | }
16 |
17 | /**
18 | * 封装所有sql文件脚本内容
19 | * @return {object}
20 | */
21 | function getSqlContentMap () {
22 | let sqlMap = getSqlMap()
23 | for( let key in sqlMap ) {
24 | getSqlContent( key, sqlMap[key] )
25 | }
26 |
27 | return sqlContentMap
28 | }
29 |
30 | module.exports = getSqlContentMap
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/mysql/util/get-sql-map.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs')
2 | const walkFile = require('./walk-file')
3 |
4 | /**
5 | * 获取sql目录下的文件目录数据
6 | * @return {object}
7 | */
8 | function getSqlMap () {
9 | let basePath = __dirname
10 | basePath = basePath.replace(/\\/g, '\/')
11 |
12 | let pathArr = basePath.split('\/')
13 | pathArr = pathArr.splice( 0, pathArr.length - 1 )
14 | basePath = pathArr.join('/') + '/sql/'
15 |
16 | let fileList = walkFile( basePath, 'sql' )
17 | return fileList
18 | }
19 |
20 | module.exports = getSqlMap
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/mysql/util/walk-file.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs')
2 |
3 | /**
4 | * 遍历目录下的文件目录
5 | * @param {string} pathResolve 需进行遍历的目录路径
6 | * @param {string} mime 遍历文件的后缀名
7 | * @return {object} 返回遍历后的目录结果
8 | */
9 | const walkFile = function( pathResolve , mime ){
10 |
11 | let files = fs.readdirSync( pathResolve )
12 |
13 | let fileList = {}
14 |
15 | for( let [ i, item] of files.entries() ) {
16 | let itemArr = item.split('\.')
17 |
18 | let itemMime = ( itemArr.length > 1 ) ? itemArr[ itemArr.length - 1 ] : 'undefined'
19 | let keyName = item + ''
20 | if( mime === itemMime ) {
21 | fileList[ item ] = pathResolve + item
22 | }
23 | }
24 |
25 | return fileList
26 | }
27 |
28 | module.exports = walkFile
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/.editorconfig:
--------------------------------------------------------------------------------
1 | [*]
2 | charset=utf-8
3 | end_of_line=lf
4 | insert_final_newline=false
5 | indent_style=space
6 | indent_size=2
7 |
8 | [{.eslintrc,.babelrc,.stylelintrc,*.json,*.jsb3,*.jsb2,*.bowerrc}]
9 | indent_style=space
10 | indent_size=2
11 |
12 | [*.less]
13 | indent_style=space
14 | indent_size=2
15 |
16 | [*.scss]
17 | indent_style=space
18 | indent_size=2
19 |
20 | [{.analysis_options,*.yml,*.yaml}]
21 | indent_style=space
22 | indent_size=2
23 |
24 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules/
2 | .idea/
3 | .DS_Store
4 | static/output/dist/
5 | static/output/upload/
6 | npm-debug.log
7 | npm-debug.log.*
8 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/config.js:
--------------------------------------------------------------------------------
1 | const config = {
2 |
3 | port: 3001,
4 |
5 | database: {
6 | DATABASE: 'koa_demo',
7 | USERNAME: 'root',
8 | PASSWORD: 'abc123',
9 | PORT: '3306',
10 | HOST: 'localhost'
11 | }
12 | }
13 |
14 | module.exports = config
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/init/sql/user_info.sql:
--------------------------------------------------------------------------------
1 | CREATE TABLE IF NOT EXISTS `user_info` (
2 | `id` int(11) NOT NULL AUTO_INCREMENT,
3 | `email` varchar(255) DEFAULT NULL,
4 | `password` varchar(255) DEFAULT NULL,
5 | `name` varchar(255) DEFAULT NULL,
6 | `nick` varchar(255) DEFAULT NULL,
7 | `detail_info` longtext DEFAULT NULL,
8 | `create_time` varchar(20) DEFAULT NULL,
9 | `modified_time` varchar(20) DEFAULT NULL,
10 | `level` int(11) DEFAULT NULL,
11 | PRIMARY KEY (`id`)
12 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
13 |
14 | INSERT INTO `user_info` set name='admin001', email='admin001@example.com', password='123456';
15 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/init/util/get-sql-content-map.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs')
2 | const getSqlMap = require('./get-sql-map')
3 |
4 | let sqlContentMap = {}
5 |
6 | /**
7 | * 读取sql文件内容
8 | * @param {string} fileName 文件名称
9 | * @param {string} path 文件所在的路径
10 | * @return {string} 脚本文件内容
11 | */
12 | function getSqlContent( fileName, path ) {
13 | let content = fs.readFileSync( path, 'binary' )
14 | sqlContentMap[ fileName ] = content
15 | }
16 |
17 | /**
18 | * 封装所有sql文件脚本内容
19 | * @return {object}
20 | */
21 | function getSqlContentMap () {
22 | let sqlMap = getSqlMap()
23 | for( let key in sqlMap ) {
24 | getSqlContent( key, sqlMap[key] )
25 | }
26 |
27 | return sqlContentMap
28 | }
29 |
30 | module.exports = getSqlContentMap
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/init/util/get-sql-map.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs')
2 | const walkFile = require('./walk-file')
3 |
4 | /**
5 | * 获取sql目录下的文件目录数据
6 | * @return {object}
7 | */
8 | function getSqlMap () {
9 | let basePath = __dirname
10 | basePath = basePath.replace(/\\/g, '\/')
11 |
12 | let pathArr = basePath.split('\/')
13 | pathArr = pathArr.splice( 0, pathArr.length - 1 )
14 | basePath = pathArr.join('/') + '/sql/'
15 |
16 | let fileList = walkFile( basePath, 'sql' )
17 | return fileList
18 | }
19 |
20 | module.exports = getSqlMap
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/server/codes/user.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 逻辑文案管理
3 | */
4 |
5 | const userCode = {
6 |
7 | ERROR_USER_NAME: '用户名格式为6-16位的小写字母,包括-、_',
8 |
9 | ERROR_EMAIL: '请输入正确的邮箱地址',
10 |
11 | ERROR_PASSWORD: '密码长度应该为6-16',
12 |
13 | ERROR_PASSWORD_CONFORM: '两次密码不一致',
14 |
15 | ERROR_SYS: '系统错误',
16 |
17 | FAIL_EMAIL_IS_EXIST: '邮箱已被注册',
18 |
19 | FAIL_USER_NAME_IS_EXIST: '用户名已被注册',
20 |
21 | FAIL_USER_NAME_OR_PASSWORD_ERROR: '用户名或登录密码错误',
22 |
23 | FAIL_USER_NO_LOGIN: '用户未登录',
24 |
25 | FAIL_USER_NO_EXIST: '用户不存在',
26 |
27 | }
28 |
29 |
30 | module.exports = userCode
31 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/server/controllers/admin.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 |
3 | async indexPage ( ctx ) {
4 | const title = 'admin page'
5 | await ctx.render('admin', {
6 | title,
7 | })
8 | },
9 |
10 | }
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/server/controllers/index.js:
--------------------------------------------------------------------------------
1 | module.exports = async ( ctx ) => {
2 | const title = 'home'
3 | await ctx.render('index', {
4 | title
5 | })
6 | }
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/server/controllers/work.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 |
3 | async indexPage ( ctx ) {
4 | // 判断是否有session
5 | if ( ctx.session && ctx.session.isLogin && ctx.session.userName ) {
6 | const title = 'work页面'
7 | await ctx.render('work', {
8 | title,
9 | })
10 | } else {
11 | // 没有登录态则跳转到错误页面
12 | ctx.redirect('/error')
13 | }
14 | },
15 |
16 | }
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/server/routers/admin.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 管理员用户子路由
3 | */
4 |
5 | const router = require('koa-router')()
6 | const admin = require('./../controllers/admin')
7 |
8 | module.exports = router.get( '/', admin.indexPage )
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/server/routers/api.js:
--------------------------------------------------------------------------------
1 | /**
2 | * restful api 子路由
3 | */
4 |
5 | const router = require('koa-router')()
6 | const userInfoController = require('./../controllers/user-info')
7 |
8 | const routers = router
9 | .get('/user/getUserInfo.json', userInfoController.getLoginUserInfo)
10 | .post('/user/signIn.json', userInfoController.signIn)
11 | .post('/user/signUp.json', userInfoController.signUp)
12 |
13 |
14 | module.exports = routers
15 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/server/routers/error.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 错误页面子路由
3 | */
4 |
5 | const router = require('koa-router')()
6 |
7 | module.exports = router.get('*', async ( ctx ) => {
8 | const title = 'error'
9 | await ctx.render('error', {
10 | title
11 | })
12 | })
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/server/routers/home.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 主页子路由
3 | */
4 |
5 | const router = require('koa-router')()
6 | const index = require('../controllers/index')
7 |
8 | module.exports = router
9 | .get('/', index)
10 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/server/routers/index.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 整合所有子路由
3 | */
4 |
5 | const router = require('koa-router')()
6 |
7 | const home = require('./home')
8 | const api = require('./api')
9 | const admin = require('./admin')
10 | const work = require('./work')
11 | const error = require('./error')
12 |
13 | router.use('/', home.routes(), home.allowedMethods())
14 | router.use('/api', api.routes(), api.allowedMethods())
15 | router.use('/admin', admin.routes(), admin.allowedMethods())
16 | router.use('/work', work.routes(), work.allowedMethods())
17 | router.use('/error', error.routes(), error.allowedMethods())
18 |
19 | module.exports = router
20 |
21 |
22 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/server/routers/work.js:
--------------------------------------------------------------------------------
1 | /**
2 | * 工作台子路由
3 | */
4 |
5 | const router = require('koa-router')()
6 | const controller = require('./../controllers/work')
7 |
8 | const routers = router
9 | .get('/', controller.indexPage)
10 |
11 |
12 | module.exports = routers
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/server/views/admin.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <%= title %>
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/server/views/error.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <%= title %>
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/server/views/index.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <%= title %>
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/server/views/work.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <%= title %>
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/static/build/webpack.dev.config.js:
--------------------------------------------------------------------------------
1 | process.env.NODE_ENV = 'development';
2 |
3 | const merge = require('webpack-merge');
4 | const config = require('./webpack.base.config');
5 |
6 | // const prodMode = process.env.NODE_ENV === 'production';
7 |
8 | module.exports = merge(config, {
9 | mode: 'development',
10 | devtool: '#source-map'
11 | });
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/static/build/webpack.prod.config.js:
--------------------------------------------------------------------------------
1 | process.env.NODE_ENV = 'production';
2 |
3 | const merge = require('webpack-merge');
4 | const UglifyJsPlugin = require('uglifyjs-webpack-plugin');
5 | const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
6 | const config = require('./webpack.base.config');
7 |
8 | module.exports = merge(config, {
9 | mode: 'production',
10 | // plugins: [
11 | // new UglifyJsPlugin()
12 | // ]
13 | optimization: {
14 | minimizer: [
15 | new UglifyJsPlugin({
16 | cache: true,
17 | parallel: true
18 | }),
19 | new OptimizeCSSAssetsPlugin({})
20 | ]
21 | }
22 | });
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/static/output/asset/image/deepsea-logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/demo/project/static/output/asset/image/deepsea-logo.jpg
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/static/src/api/sign-in.js:
--------------------------------------------------------------------------------
1 | import Request from './../utils/request'
2 |
3 | const signInApi = async ( userInfo ) => {
4 | let result = await Request.post({
5 | url: '/api/user/signIn.json',
6 | data: userInfo
7 | })
8 | return result
9 | }
10 |
11 | const signInForm = ( userInfo ) => {
12 | userInfo.source = 'form';
13 | Request.form({
14 | url: '/api/user/signIn.json',
15 | data: userInfo,
16 | })
17 | }
18 |
19 | export { signInApi , signInForm }
20 |
21 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/static/src/components/footer-common.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import ReactDOM from 'react-dom'
3 | import { Layout, Menu, Breadcrumb } from 'antd'
4 | const { Footer } = Layout
5 |
6 | class FooterCommon extends React.Component {
7 | render() {
8 | return (
9 |
12 | )
13 | }
14 | }
15 |
16 |
17 | export default FooterCommon
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/static/src/components/form-group.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { Tabs } from 'antd'
3 | import SignInForm from './../components/sign-in-form.jsx'
4 | import SignUpForm from './../components/sign-up-form.jsx'
5 |
6 | const TabPane = Tabs.TabPane
7 |
8 | class FormGroup extends React.Component {
9 | render() {
10 | return (
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | )
22 | }
23 | }
24 |
25 | export default FormGroup
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/static/src/css/index.less:
--------------------------------------------------------------------------------
1 | @import './../../../node_modules/antd/dist/antd.css';
2 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/static/src/pages/admin.js:
--------------------------------------------------------------------------------
1 | import '@babel/polyfill';
2 | import 'whatwg-fetch'
3 | import React from 'react'
4 | import ReactDOM from 'react-dom'
5 | import App from './../apps/admin.jsx'
6 |
7 | ReactDOM.render( ,
8 | document.getElementById("app"))
9 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/static/src/pages/error.js:
--------------------------------------------------------------------------------
1 | import '@babel/polyfill';
2 | import React from 'react'
3 | import ReactDOM from 'react-dom'
4 | import App from './../apps/error.jsx'
5 |
6 | ReactDOM.render( ,
7 | document.getElementById("app"))
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/static/src/pages/index.js:
--------------------------------------------------------------------------------
1 | import '@babel/polyfill';
2 | import React from 'react'
3 | import ReactDOM from 'react-dom'
4 | import App from './../apps/index.jsx'
5 |
6 | ReactDOM.render( ,
7 | document.getElementById("app"))
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/static/src/pages/work.js:
--------------------------------------------------------------------------------
1 | import '@babel/polyfill';
2 | import React from 'react'
3 | import ReactDOM from 'react-dom'
4 | import App from './../apps/work.jsx'
5 |
6 | ReactDOM.render( ,
7 | document.getElementById("app"))
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/static/src/texts/common.js:
--------------------------------------------------------------------------------
1 | const common = {
2 | BTN_SUBMIT_NAME: '确定',
3 |
4 | NO_LOGIN: '未登录',
5 | }
6 |
7 | export default common
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/project/static/src/texts/user-text.js:
--------------------------------------------------------------------------------
1 | const UserText = {
2 |
3 | USER_INFO_LABEL_NAME: '用户名称',
4 |
5 | USER_INFO_LABEL_EMAIL: '用户邮件',
6 |
7 | USER_INFO_LABEL_PASSWORD: '密码',
8 |
9 | USER_INFO_LABEL_CONFIRM_PASSWORD: '确认密码',
10 |
11 | USER_INFO_PLACEHOLDER_NAME: '请输入用户名称',
12 |
13 | USER_INFO_PLACEHOLDER_EMAIL: '请输入邮箱地址',
14 |
15 | USER_INFO_PLACEHOLDER_PASSWORD: '请输入密码',
16 |
17 | USER_INFO_PLACEHOLDER_CONFIRM_PASSWORD: '请再次输入密码确认',
18 |
19 | USER_INFO_BTN_SUBMIT: '确认',
20 |
21 | }
22 |
23 | export default UserText
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/request/get.js:
--------------------------------------------------------------------------------
1 | const Koa = require('koa')
2 | const app = new Koa()
3 |
4 | app.use( async ( ctx ) => {
5 | let url = ctx.url
6 |
7 | // 从上下文的request对象中获取
8 | let request = ctx.request
9 | let req_query = request.query
10 | let req_querystring = request.querystring
11 |
12 | // 从上下文中直接获取
13 | let ctx_query = ctx.query
14 | let ctx_querystring = ctx.querystring
15 |
16 | ctx.body = {
17 | url,
18 | req_query,
19 | req_querystring,
20 | ctx_query,
21 | ctx_querystring
22 | }
23 | })
24 |
25 | app.listen(3000, () => {
26 | console.log('[demo] request get is starting at port 3000')
27 | })
28 |
29 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/request/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "request-get",
3 | "version": "1.0.0",
4 | "description": "koa request get",
5 | "main": "index.js",
6 | "scripts": {
7 | "get": "node get.js",
8 | "post": "node post.js"
9 | },
10 | "keywords": [
11 | "koajs"
12 | ],
13 | "author": "chenshenhai",
14 | "license": "MIT",
15 | "dependencies": {
16 | "koa": "^2.3.0",
17 | "koa-bodyparser": "^3.2.0"
18 | },
19 | "engines": {
20 | "node": ">=7.6.0",
21 | "npm": ">=3.0.0"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/route-simple/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "route-simple",
3 | "version": "1.0.0",
4 | "description": "koa route demo",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node index.js"
8 | },
9 | "keywords": [
10 | "koajs"
11 | ],
12 | "author": "chenshenhai",
13 | "license": "MIT",
14 | "dependencies": {
15 | "koa": "^2.3.0"
16 | },
17 | "engines": {
18 | "node": ">=7.6.0",
19 | "npm": ">=3.0.0"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/route-simple/view/404.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | 404
6 |
7 |
8 | koa2 demo 404 page
9 | this is a 404 page
10 |
11 |
12 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/route-simple/view/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | index
6 |
7 |
8 | koa2 demo index page
9 | this is a index page
10 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/route-simple/view/todo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | todo
6 |
7 |
8 | koa2 demo todo page
9 | this is a todo page
10 |
11 |
12 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/route-use-middleware/index.js:
--------------------------------------------------------------------------------
1 | const Koa = require('koa')
2 | const fs = require('fs')
3 | const app = new Koa()
4 | const router = require('./routers/index')
5 |
6 | app.use(router.routes()).use(router.allowedMethods())
7 |
8 | app.listen(3000, () => {
9 | console.log('[demo] route-use-middleware is starting at port 3000')
10 | })
11 |
12 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/route-use-middleware/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "route-use-middleware",
3 | "version": "1.0.0",
4 | "description": "koa route demo",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node index.js"
8 | },
9 | "keywords": [
10 | "koajs"
11 | ],
12 | "author": "chenshenhai",
13 | "license": "MIT",
14 | "dependencies": {
15 | "koa": "^2.3.0",
16 | "koa-router": "^7.2.1"
17 | },
18 | "engines": {
19 | "node": ">=7.6.0",
20 | "npm": ">=3.0.0"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/route-use-middleware/routers/api.js:
--------------------------------------------------------------------------------
1 | const router = require('koa-router')()
2 |
3 | module.exports = router.get('/get/data.json', async ( ctx )=>{
4 | ctx.body = {
5 | success: true,
6 | data: {
7 | text: 'hello world!'
8 | }
9 | }
10 | }).get('/get/user.json', async ( ctx )=>{
11 | ctx.body = {
12 | success: true,
13 | data: {
14 | text: 'my name is koa.js!'
15 | }
16 | }
17 | })
18 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/route-use-middleware/routers/home.js:
--------------------------------------------------------------------------------
1 | const router = require('koa-router')()
2 |
3 | module.exports = router.get('/', async ( ctx )=>{
4 | let html = `
5 |
11 | `
12 | ctx.body = html
13 | })
14 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/route-use-middleware/routers/index.js:
--------------------------------------------------------------------------------
1 | const router = require('koa-router')()
2 |
3 | const home = require('./home')
4 | const api = require('./api')
5 | const page = require('./page')
6 |
7 | router.use('/', home.routes(), home.allowedMethods())
8 | router.use('/api', api.routes(), api.allowedMethods())
9 | router.use('/page', page.routes(), page.allowedMethods())
10 |
11 | module.exports = router
12 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/route-use-middleware/routers/page.js:
--------------------------------------------------------------------------------
1 | const router = require('koa-router')()
2 |
3 | module.exports = router.get('/404', async ( ctx )=>{
4 | ctx.body = '404 page!'
5 | }).get('/helloworld', async ( ctx )=>{
6 | ctx.body = 'helloworld page!'
7 | })
8 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/session/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "session",
3 | "version": "1.0.0",
4 | "description": "koa start demo",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node index.js"
8 | },
9 | "keywords": [
10 | "koajs"
11 | ],
12 | "author": "chenshenhai",
13 | "license": "MIT",
14 | "dependencies": {
15 | "koa": "^2.3.0",
16 | "koa-mysql-session": "^0.0.2",
17 | "koa-session-minimal": "^3.0.4"
18 | },
19 | "engines": {
20 | "node": ">=7.6.0",
21 | "npm": ">=3.0.0"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/start-async/index.js:
--------------------------------------------------------------------------------
1 | const Koa = require('koa')
2 | const render = require('./util/render')
3 | const app = new Koa()
4 |
5 | app.use( async ( ctx ) => {
6 | let html = await render('index.html')
7 | ctx.body = html
8 | })
9 |
10 | app.listen(3000, () => {
11 | console.log('[demo] start-async is starting at port 3000')
12 | })
13 |
14 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/start-async/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "start-quick",
3 | "version": "1.0.0",
4 | "description": "koa start demo",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node index.js"
8 | },
9 | "keywords": [
10 | "koajs"
11 | ],
12 | "author": "chenshenhai",
13 | "license": "MIT",
14 | "dependencies": {
15 | "koa": "^2.3.0"
16 | },
17 | "engines": {
18 | "node": ">=7.6.0",
19 | "npm": ">=3.0.0"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/start-async/util/render.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs')
2 |
3 | function render( page ) {
4 |
5 | return new Promise(( resolve, reject ) => {
6 |
7 | let viewUrl = `./view/${page}`
8 | fs.readFile(viewUrl, "binary", ( err, data ) => {
9 | if ( err ) {
10 | reject( err )
11 | } else {
12 | resolve( data )
13 | }
14 | })
15 | })
16 |
17 | }
18 |
19 | module.exports = render
20 |
21 |
22 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/start-async/view/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | index
6 |
7 |
8 | koa2 async/await
9 |
10 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/start-quick/index.js:
--------------------------------------------------------------------------------
1 | const Koa = require('koa')
2 | const app = new Koa()
3 |
4 | app.use( async ( ctx ) => {
5 | ctx.body = 'hello koa2'
6 | })
7 |
8 | app.listen(3000, () => {
9 | console.log('[demo] start-quick is starting at port 3000')
10 | })
11 |
12 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/start-quick/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "start-quick",
3 | "version": "1.0.0",
4 | "description": "koa start demo",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node index.js"
8 | },
9 | "keywords": [
10 | "koajs"
11 | ],
12 | "author": "chenshenhai",
13 | "license": "MIT",
14 | "dependencies": {
15 | "koa": "^2.3.0"
16 | },
17 | "engines": {
18 | "node": ">=7.6.0",
19 | "npm": ">=3.0.0"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/static-server/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "static-simple",
3 | "version": "1.0.0",
4 | "description": "koa start demo",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node index.js"
8 | },
9 | "keywords": [
10 | "koajs"
11 | ],
12 | "author": "chenshenhai",
13 | "license": "MIT",
14 | "dependencies": {
15 | "koa": "^2.3.0"
16 | },
17 | "engines": {
18 | "node": ">=7.6.0",
19 | "npm": ">=3.0.0"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/static-server/static/css/style.css:
--------------------------------------------------------------------------------
1 | .h1 {
2 | padding: 20px;
3 | color: #222;
4 | background: #f0f0f0;
5 | }
6 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/static-server/static/image/nodejs.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/demo/static-server/static/image/nodejs.jpg
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/static-server/static/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | index
6 |
7 |
8 |
9 | koa2 simple static server
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/static-server/static/js/index.js:
--------------------------------------------------------------------------------
1 | (function( ){
2 | alert('hello koa2 static server')
3 | console.log('hello koa2 static server')
4 | })()
5 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/static-server/util/dir.js:
--------------------------------------------------------------------------------
1 | const url = require('url')
2 | const fs = require('fs')
3 | const path = require('path')
4 |
5 | // 遍历读取目录内容方法
6 | const walk = require('./walk')
7 |
8 | /**
9 | * 封装目录内容
10 | * @param {string} url 当前请求的上下文中的url,即ctx.url
11 | * @param {string} reqPath 请求静态资源的完整本地路径
12 | * @return {string} 返回目录内容,封装成HTML
13 | */
14 | function dir ( url, reqPath ) {
15 |
16 | // 遍历读取当前目录下的文件、子目录
17 | let contentList = walk( reqPath )
18 |
19 | let html = ``
20 | for ( let [ index, item ] of contentList.entries() ) {
21 | html = `${html}- ${item}
`
22 | }
23 | html = `${html}
`
24 |
25 | return html
26 | }
27 |
28 | module.exports = dir
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/static-server/util/file.js:
--------------------------------------------------------------------------------
1 | const fs = require('fs')
2 |
3 | /**
4 | * 读取文件方法
5 | * @param {string} 文件本地的绝对路径
6 | * @return {string|binary}
7 | */
8 | function file ( filePath ) {
9 |
10 | let content = fs.readFileSync(filePath, 'binary' )
11 | return content
12 | }
13 |
14 | module.exports = file
15 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/static-server/util/mimes.js:
--------------------------------------------------------------------------------
1 | let mimes = {
2 | 'css': 'text/css',
3 | 'less': 'text/css',
4 | 'gif': 'image/gif',
5 | 'html': 'text/html',
6 | 'ico': 'image/x-icon',
7 | 'jpeg': 'image/jpeg',
8 | 'jpg': 'image/jpeg',
9 | 'js': 'text/javascript',
10 | 'json': 'application/json',
11 | 'pdf': 'application/pdf',
12 | 'png': 'image/png',
13 | 'svg': 'image/svg+xml',
14 | 'swf': 'application/x-shockwave-flash',
15 | 'tiff': 'image/tiff',
16 | 'txt': 'text/plain',
17 | 'wav': 'audio/x-wav',
18 | 'wma': 'audio/x-ms-wma',
19 | 'wmv': 'video/x-ms-wmv',
20 | 'xml': 'text/xml'
21 | }
22 |
23 | module.exports = mimes
24 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/static-use-middleware/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "static-use-middleware",
3 | "version": "1.0.0",
4 | "description": "koa start demo",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node ./src/index.js"
8 | },
9 | "keywords": [
10 | "koajs"
11 | ],
12 | "author": "chenshenhai",
13 | "license": "MIT",
14 | "dependencies": {
15 | "koa": "^2.3.0",
16 | "koa-static": "^3.0.0"
17 | },
18 | "engines": {
19 | "node": ">=7.6.0",
20 | "npm": ">=3.0.0"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/static-use-middleware/src/index.js:
--------------------------------------------------------------------------------
1 | const Koa = require('koa')
2 | const path = require('path')
3 | const static = require('koa-static')
4 |
5 | const app = new Koa()
6 |
7 | // 静态资源目录对于相对入口文件index.js的路径
8 | const staticPath = '../static'
9 |
10 | app.use(static(
11 | path.join( __dirname, staticPath)
12 | ))
13 |
14 |
15 | // app.use( async ( ctx ) => {
16 | // ctx.body = 'hello world'
17 | // })
18 |
19 | app.listen(8080, () => {
20 | console.log('[demo] static-use-middleware is starting at port 3000')
21 | })
22 |
23 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/static-use-middleware/static/css/style.css:
--------------------------------------------------------------------------------
1 | .h1 {
2 | padding: 20px;
3 | color: #222;
4 | background: #f0f0f0;
5 | }
6 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/static-use-middleware/static/image/nodejs.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/demo/static-use-middleware/static/image/nodejs.jpg
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/static-use-middleware/static/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | index
6 |
7 |
8 |
9 | koa2 simple static server
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/static-use-middleware/static/js/index.js:
--------------------------------------------------------------------------------
1 | (function( ){
2 | alert('hello koa2 static server')
3 | console.log('hello koa2 static server')
4 | })()
5 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/test-unit/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "test-mocha",
3 | "version": "1.0.0",
4 | "description": "koa test demo",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node index.js",
8 | "test": "./node_modules/.bin/mocha --harmony"
9 | },
10 | "keywords": [
11 | "koajs"
12 | ],
13 | "author": "chenshenhai",
14 | "license": "MIT",
15 | "dependencies": {
16 | "koa": "^2.0.1"
17 | },
18 | "engines": {
19 | "node": ">=7.6.0",
20 | "npm": ">=3.0.0"
21 | },
22 | "devDependencies": {
23 | "chai": "^3.5.0",
24 | "mocha": "^3.2.0",
25 | "supertest": "^3.0.0"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/upload-async/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "upload-async",
3 | "version": "1.0.0",
4 | "description": "koa upload-async demo",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node index.js"
8 | },
9 | "keywords": [
10 | "koajs"
11 | ],
12 | "author": "chenshenhai",
13 | "license": "MIT",
14 | "dependencies": {
15 | "busboy": "^0.2.14",
16 | "ejs": "^2.5.7",
17 | "koa": "^2.3.0",
18 | "koa-static": "^3.0.0",
19 | "koa-views": "^5.2.1"
20 | },
21 | "engines": {
22 | "node": ">=7.6.0",
23 | "npm": ">=3.0.0"
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/upload-async/view/index.ejs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | <%= title %>
5 |
14 |
15 |
16 |
17 |
18 | 上传进度0%
19 | 上传结果图片
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/demo/upload/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "request-get",
3 | "version": "1.0.0",
4 | "description": "koa request get",
5 | "main": "index.js",
6 | "scripts": {
7 | "start": "node index.js"
8 | },
9 | "keywords": [
10 | "koajs"
11 | ],
12 | "author": "chenshenhai",
13 | "license": "MIT",
14 | "dependencies": {
15 | "busboy": "^0.2.14",
16 | "koa": "^2.3.0"
17 | },
18 | "engines": {
19 | "node": ">=7.6.0",
20 | "npm": ">=3.0.0"
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/async.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/async.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/cookie-result-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/cookie-result-01.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/debug-result-001.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/debug-result-001.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/debug-result-002.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/debug-result-002.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/debug-result-003.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/debug-result-003.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/debug-result-004.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/debug-result-004.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/debug-result-005.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/debug-result-005.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/debug-result-006.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/debug-result-006.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/debug-result-007.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/debug-result-007.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/debug-result-008.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/debug-result-008.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/jsonp-result-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/jsonp-result-01.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/jsonp-result-02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/jsonp-result-02.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/jsonp-wiki.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/jsonp-wiki.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/mysql-init-result-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/mysql-init-result-01.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/mysql-init-result-02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/mysql-init-result-02.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/project-result-00.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/project-result-00.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/project-result-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/project-result-01.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/project-result-02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/project-result-02.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/project-result-03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/project-result-03.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/request-get.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/request-get.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/request-post-form.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/request-post-form.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/request-post-result.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/request-post-result.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/route-result-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/route-result-01.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/session-result-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/session-result-01.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/session-result-02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/session-result-02.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/session-result-03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/session-result-03.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/start-result-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/start-result-01.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/static-server-result-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/static-server-result-01.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/static-server-result-02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/static-server-result-02.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/static-server-result-03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/static-server-result-03.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/test-unit-result-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/test-unit-result-01.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/test-unit-result-02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/test-unit-result-02.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/test-unit-result-03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/test-unit-result-03.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/upload-async-result-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/upload-async-result-01.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/upload-simple-result-01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/upload-simple-result-01.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/upload-simple-result-02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/upload-simple-result-02.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/upload-simple-result-03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/upload-simple-result-03.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/images/upload-simple-result-04.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/##koa2-note##/koa2-note/note/images/upload-simple-result-04.png
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/project/layer.md:
--------------------------------------------------------------------------------
1 | # 分层设计
2 |
3 | ## 后端代码目录
4 | ```sh
5 | └── server
6 | ├── controllers # 操作层 执行服务端模板渲染,json接口返回数据,页面跳转
7 | │ ├── admin.js
8 | │ ├── index.js
9 | │ ├── user-info.js
10 | │ └── work.js
11 | ├── models # 数据模型层 执行数据操作
12 | │ └── user-Info.js
13 | ├── routers # 路由层 控制路由
14 | │ ├── admin.js
15 | │ ├── api.js
16 | │ ├── error.js
17 | │ ├── home.js
18 | │ ├── index.js
19 | │ └── work.js
20 | ├── services # 业务层 实现数据层model到操作层controller的耦合封装
21 | │ └── user-info.js
22 | └── views # 服务端模板代码
23 | ├── admin.ejs
24 | ├── error.ejs
25 | ├── index.ejs
26 | └── work.ejs
27 | ```
28 |
29 |
--------------------------------------------------------------------------------
/##koa2-note##/koa2-note/note/template/ejs.md:
--------------------------------------------------------------------------------
1 | # ejs模板引擎
2 |
3 | ## 具体查看ejs官方文档
4 | [https://github.com/mde/ejs](https://github.com/mde/ejs)
--------------------------------------------------------------------------------
/##webpack##/wepack-keypoint.md:
--------------------------------------------------------------------------------
1 | 1. code runner
2 | 2. path路径必须是一个绝对路径
3 |
--------------------------------------------------------------------------------
/#linux-note#/.黑马程序员 linux从入门到精通配套笔记.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/#linux-note#/.黑马程序员 linux从入门到精通配套笔记.docx
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 博客完成更新了https://www.hansomezao.com
2 |
--------------------------------------------------------------------------------
/books/你不知道的JavaScript(上卷).pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/你不知道的JavaScript(上卷).pdf
--------------------------------------------------------------------------------
/books/你不知道的JavaScript(下卷).pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/你不知道的JavaScript(下卷).pdf
--------------------------------------------------------------------------------
/books/你不知道的JavaScript(中卷).pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/你不知道的JavaScript(中卷).pdf
--------------------------------------------------------------------------------
/books/函数式编程.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程.pdf
--------------------------------------------------------------------------------
/books/函数式编程/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | grunt
3 | less
4 | Gruntfile.js
5 | npm-debug.log
6 | .DS_Store
7 | *.swp
8 |
--------------------------------------------------------------------------------
/books/函数式编程/LICENSE.md:
--------------------------------------------------------------------------------
1 | * 本书所有文字都采用以下许可:
2 | 知识共享署名-相同方式共享 4.0 国际许可协议 (CC BY-SA 4.0)
3 | http://creativecommons.org/licenses/by-sa/4.0/
4 |
5 | * 所有的图片都取自 Google 图片搜索,所以上述许可对这些图片不适用。如果图片中有你的作品,请务必告知我,我会注明出处并致谢或删除图片。
6 |
--------------------------------------------------------------------------------
/books/函数式编程/code/lib/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "MAG_lib",
3 | "version": "0.0.1",
4 | "description": "Support libs for the book",
5 | "main": "index.js",
6 | "dependencies": {
7 | "ramda": "^0.13.0"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "https://github.com/DrBoolean/mostly-adequate-guide"
12 | },
13 | "author": "",
14 | "license": "ISC",
15 | "bugs": {
16 | "url": "https://github.com/DrBoolean/mostly-adequate-guide/issues"
17 | },
18 | "homepage": "https://github.com/DrBoolean/mostly-adequate-guide"
19 | }
20 |
--------------------------------------------------------------------------------
/books/函数式编程/code/part1_demo/flickr.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/books/函数式编程/code/part1_exercises/README.md:
--------------------------------------------------------------------------------
1 | Part 1 Exercises
2 | ==================
3 |
4 | **Installation**:
5 | `npm install`
6 |
7 | **Running tests**:
8 | Tests are located in their corresponding folders. To run:
9 |
10 | ```
11 | cd exercises/curry
12 | mocha *spec.js
13 | ```
14 |
15 | Some will fail and some will pass. You'll need to edit the exercises until the tests pass.
16 |
--------------------------------------------------------------------------------
/books/函数式编程/code/part2_exercises/README.md:
--------------------------------------------------------------------------------
1 | Part 2 Exercises
2 | ==================
3 |
4 | **Installation**:
5 | `npm install`
6 |
7 | **Running tests**:
8 | Tests are located in their corresponding folders. To run:
9 |
10 | ```
11 | cd exercises/curry
12 | mocha *spec.js
13 | ```
14 |
15 | Some will fail and some will pass. You'll need to edit the exercises until the tests pass.
16 |
--------------------------------------------------------------------------------
/books/函数式编程/images/canopener.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/canopener.jpg
--------------------------------------------------------------------------------
/books/函数式编程/images/cat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/cat.png
--------------------------------------------------------------------------------
/books/函数式编程/images/cat_comp1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/cat_comp1.png
--------------------------------------------------------------------------------
/books/函数式编程/images/cat_comp2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/cat_comp2.png
--------------------------------------------------------------------------------
/books/函数式编程/images/cat_theory.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/cat_theory.png
--------------------------------------------------------------------------------
/books/函数式编程/images/catmap copy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/catmap copy.png
--------------------------------------------------------------------------------
/books/函数式编程/images/catmap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/catmap.png
--------------------------------------------------------------------------------
/books/函数式编程/images/cats_ss.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/cats_ss.png
--------------------------------------------------------------------------------
/books/函数式编程/images/chain.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/chain.jpg
--------------------------------------------------------------------------------
/books/函数式编程/images/console_ss.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/console_ss.png
--------------------------------------------------------------------------------
/books/函数式编程/images/cover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/cover.png
--------------------------------------------------------------------------------
/books/函数式编程/images/dominoes.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/dominoes.jpg
--------------------------------------------------------------------------------
/books/函数式编程/images/fists.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/fists.jpg
--------------------------------------------------------------------------------
/books/函数式编程/images/fn_graph.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/fn_graph.png
--------------------------------------------------------------------------------
/books/函数式编程/images/function-sets.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/function-sets.gif
--------------------------------------------------------------------------------
/books/函数式编程/images/functormap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/functormap.png
--------------------------------------------------------------------------------
/books/函数式编程/images/functormapmaybe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/functormapmaybe.png
--------------------------------------------------------------------------------
/books/函数式编程/images/jar.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/jar.jpg
--------------------------------------------------------------------------------
/books/函数式编程/images/monad_associativity.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/monad_associativity.png
--------------------------------------------------------------------------------
/books/函数式编程/images/natural_transformation.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/natural_transformation.png
--------------------------------------------------------------------------------
/books/函数式编程/images/onion.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/onion.png
--------------------------------------------------------------------------------
/books/函数式编程/images/plugs.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/plugs.jpg
--------------------------------------------------------------------------------
/books/函数式编程/images/relation-not-function.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/relation-not-function.gif
--------------------------------------------------------------------------------
/books/函数式编程/images/ship_in_a_bottle.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/ship_in_a_bottle.jpg
--------------------------------------------------------------------------------
/books/函数式编程/images/triangle_identity.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/books/函数式编程/images/triangle_identity.png
--------------------------------------------------------------------------------
/electron/electron.md:
--------------------------------------------------------------------------------
1 | 1. app常用事件
2 | + ready:当electron完成初始化时被触发
3 | + window-all-closed:所有窗口被关闭
4 | + before-quit:当应用程序开始关闭窗口之前触发
5 | + will-quit:当所有窗口都已关闭并且应用程序将退出时发出
6 | + quit:在应用程序退出时发出
7 |
8 | 2. webContents常用事件
9 | + did-finished-load:导航完成时触发,即选项卡的旋转器将停止旋转,并指派onload事件后。
10 | + dom-ready:一个框架中的文本加载完成后触发该事件。
--------------------------------------------------------------------------------
/git/README.md:
--------------------------------------------------------------------------------
1 | ### 获取本地SSH Key:
2 | ```sh
3 | ls ~/.ssh
4 |
5 | cat ~/.ssh/id_rsa.pub
6 | ```
7 |
8 | ### 在远程仓库的master分支基础上建立新分支:
9 | ```
10 | git checkout master -b dev
11 |
12 | git push origin dev
13 | ```
--------------------------------------------------------------------------------
/react/README.md:
--------------------------------------------------------------------------------
1 | ### React 学习过程中的一些笔记, 包含:
2 |
3 | - React 知识点
4 | - Redux
5 | - Redux-saga
6 | - React源码学习( version: 16.6.1 )
--------------------------------------------------------------------------------
/react/react-tuts/immutable/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-tuts/immutable/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/react/react-tuts/immutable/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-tuts/immutable/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/immutable/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import {
3 | CounterBtn,
4 | CounterDisplay
5 | } from './components'
6 | import { connect } from 'react-redux'
7 | import { increment, decrement } from './actions/counter'
8 |
9 | class App extends Component {
10 | render() {
11 | return (
12 | <>
13 | -
14 |
15 | +
16 | >
17 | )
18 | }
19 | }
20 |
21 | export default connect(null, { increment, decrement })(App)
22 |
--------------------------------------------------------------------------------
/react/react-tuts/immutable/src/actions/counter.js:
--------------------------------------------------------------------------------
1 | export const increment = () => {
2 | return {
3 | type: 'INCREMENT'
4 | }
5 | }
6 |
7 | export const decrement = () => {
8 | return {
9 | type: 'DECREMENT'
10 | }
11 | }
--------------------------------------------------------------------------------
/react/react-tuts/immutable/src/components/CounterBtn/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | export default class CounterBtn extends Component {
4 | render() {
5 | return (
6 |
7 | )
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/react/react-tuts/immutable/src/components/CounterDisplay/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | import { connect } from 'react-redux'
4 |
5 | class CounterDisplay extends Component {
6 | render() {
7 | return (
8 |
9 | {this.props.count}
10 |
11 | )
12 | }
13 | }
14 |
15 | const mapStateToProps = state => {
16 | return {
17 | count: state.getIn(['counter', 'count'])
18 | }
19 | }
20 |
21 | export default connect(mapStateToProps)(CounterDisplay)
22 |
--------------------------------------------------------------------------------
/react/react-tuts/immutable/src/components/index.js:
--------------------------------------------------------------------------------
1 | export { default as CounterBtn } from './CounterBtn'
2 | export { default as CounterDisplay } from './CounterDisplay'
--------------------------------------------------------------------------------
/react/react-tuts/immutable/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { render } from 'react-dom'
3 |
4 | import { Provider } from 'react-redux'
5 |
6 | import App from './App'
7 |
8 | import store from './store'
9 |
10 | render(
11 |
12 |
13 | ,
14 | document.querySelector("#root")
15 | )
16 |
--------------------------------------------------------------------------------
/react/react-tuts/immutable/src/reducers/counter.js:
--------------------------------------------------------------------------------
1 | import { fromJS } from 'immutable'
2 |
3 | const initState = fromJS({
4 | count: 100
5 | })
6 |
7 | export default (state = initState, action) => {
8 | switch(action.type) {
9 | case 'INCREMENT':
10 | // return state.setIn(['count'], state.get('count') + 1)
11 | return state.updateIn(['count'], v => v + 1)
12 | case 'DECREMENT':
13 | return state.update('count', v => v - 1)
14 | default:
15 | return state
16 | }
17 | }
--------------------------------------------------------------------------------
/react/react-tuts/immutable/src/reducers/index.js:
--------------------------------------------------------------------------------
1 | import { combineReducers } from 'redux-immutable'
2 |
3 | import counter from './counter'
4 |
5 | export default combineReducers({
6 | counter
7 | })
--------------------------------------------------------------------------------
/react/react-tuts/immutable/src/store.js:
--------------------------------------------------------------------------------
1 | import { createStore } from 'redux'
2 | import rootReducer from './reducers'
3 |
4 | export default createStore(
5 | rootReducer
6 | )
--------------------------------------------------------------------------------
/react/react-tuts/lesson-01/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-01/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-tuts",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "react": "^16.8.6",
7 | "react-dom": "^16.8.6",
8 | "react-scripts": "3.0.1"
9 | },
10 | "scripts": {
11 | "start": "react-scripts start",
12 | "build": "react-scripts build",
13 | "test": "react-scripts test",
14 | "eject": "react-scripts eject"
15 | },
16 | "eslintConfig": {
17 | "extends": "react-app"
18 | },
19 | "browserslist": {
20 | "production": [
21 | ">0.2%",
22 | "not dead",
23 | "not op_mini all"
24 | ],
25 | "development": [
26 | "last 1 chrome version",
27 | "last 1 firefox version",
28 | "last 1 safari version"
29 | ]
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-01/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/react/react-tuts/lesson-01/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-tuts/lesson-01/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-02/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-02/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-tuts",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "react": "^16.8.6",
7 | "react-dom": "^16.8.6",
8 | "react-scripts": "3.0.1"
9 | },
10 | "scripts": {
11 | "start": "react-scripts start",
12 | "build": "react-scripts build",
13 | "test": "react-scripts test",
14 | "eject": "react-scripts eject"
15 | },
16 | "eslintConfig": {
17 | "extends": "react-app"
18 | },
19 | "browserslist": {
20 | "production": [
21 | ">0.2%",
22 | "not dead",
23 | "not op_mini all"
24 | ],
25 | "development": [
26 | "last 1 chrome version",
27 | "last 1 firefox version",
28 | "last 1 safari version"
29 | ]
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-02/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/react/react-tuts/lesson-02/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-tuts/lesson-02/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-03/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-03/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-tuts",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "react": "^16.8.6",
7 | "react-dom": "^16.8.6",
8 | "react-scripts": "3.0.1"
9 | },
10 | "scripts": {
11 | "start": "react-scripts start",
12 | "build": "react-scripts build",
13 | "test": "react-scripts test",
14 | "eject": "react-scripts eject"
15 | },
16 | "eslintConfig": {
17 | "extends": "react-app"
18 | },
19 | "browserslist": {
20 | "production": [
21 | ">0.2%",
22 | "not dead",
23 | "not op_mini all"
24 | ],
25 | "development": [
26 | "last 1 chrome version",
27 | "last 1 firefox version",
28 | "last 1 safari version"
29 | ]
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-03/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/react/react-tuts/lesson-03/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-tuts/lesson-03/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-04/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-04/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/react/react-tuts/lesson-04/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-tuts/lesson-04/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-04/src/index.css:
--------------------------------------------------------------------------------
1 | .has-text-red {
2 | color: #F00
3 | }
--------------------------------------------------------------------------------
/react/react-tuts/lesson-05/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-05/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-tuts",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "react": "^16.8.6",
7 | "react-dom": "^16.8.6",
8 | "react-scripts": "3.0.1"
9 | },
10 | "scripts": {
11 | "start": "react-scripts start",
12 | "build": "react-scripts build",
13 | "test": "react-scripts test",
14 | "eject": "react-scripts eject"
15 | },
16 | "eslintConfig": {
17 | "extends": "react-app"
18 | },
19 | "browserslist": {
20 | "production": [
21 | ">0.2%",
22 | "not dead",
23 | "not op_mini all"
24 | ],
25 | "development": [
26 | "last 1 chrome version",
27 | "last 1 firefox version",
28 | "last 1 safari version"
29 | ]
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-05/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/react/react-tuts/lesson-05/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-tuts/lesson-05/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-05/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component, Fragment } from 'react'
2 | import {
3 | TodoHeader,
4 | TodoInput,
5 | TodoList
6 | } from './components'
7 |
8 | export default class App extends Component {
9 | render() {
10 | return (
11 |
12 |
13 |
14 |
15 |
16 | // <>
17 | //
18 | //
19 | //
20 | // >
21 | )
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-05/src/components/TodoHeader/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | export default function TodoHeader() {
4 | return (
5 |
6 | 待办事项列表
7 |
8 | )
9 | }
10 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-05/src/components/TodoInput/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | export default class TodoInput extends Component {
4 | render() {
5 | return (
6 |
7 |
8 |
9 | )
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-05/src/components/TodoList/TodoItem.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | export default function TodoItem() {
4 | return (
5 |
6 | TodoItem
7 |
8 | )
9 | }
10 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-05/src/components/TodoList/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import TodoItem from './TodoItem'
3 |
4 | export default class TodoList extends Component {
5 | render() {
6 | return (
7 |
10 | )
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-05/src/components/index.js:
--------------------------------------------------------------------------------
1 | // import TodoHeader from './TodoHeader'
2 | // import TodoInput from './TodoInput'
3 | // import TodoList from './TodoList'
4 |
5 | // export {
6 | // TodoHeader,
7 | // TodoInput,
8 | // TodoList
9 | // }
10 |
11 | export { default as TodoHeader } from './TodoHeader'
12 | export { default as TodoInput } from './TodoInput'
13 | export { default as TodoList } from './TodoList'
--------------------------------------------------------------------------------
/react/react-tuts/lesson-05/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { render } from 'react-dom'
3 |
4 | import App from './App'
5 |
6 | render(
7 | ,
8 | document.querySelector('#root')
9 | )
10 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-06/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-06/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/react/react-tuts/lesson-06/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-tuts/lesson-06/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-06/src/components/TodoHeader/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 |
4 | export default function TodoHeader(props) {
5 | console.log(props)
6 | return (
7 | <>
8 |
9 | {props.children}
10 |
11 | {props.desc}
12 | >
13 | )
14 | }
15 |
16 | TodoHeader.propTypes = {
17 | desc: PropTypes.string.isRequired
18 | }
19 | TodoHeader.defaultProps = {
20 | desc: '如果还有明天'
21 | }
22 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-06/src/components/index.js:
--------------------------------------------------------------------------------
1 | // import TodoHeader from './TodoHeader'
2 | // import TodoInput from './TodoInput'
3 | // import TodoList from './TodoList'
4 |
5 | // export {
6 | // TodoHeader,
7 | // TodoInput,
8 | // TodoList
9 | // }
10 |
11 | export { default as TodoHeader } from './TodoHeader'
12 | export { default as TodoInput } from './TodoInput'
13 | export { default as TodoList } from './TodoList'
14 | export { default as Like } from './Like'
--------------------------------------------------------------------------------
/react/react-tuts/lesson-06/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { render } from 'react-dom'
3 |
4 | import App from './App'
5 |
6 | render(
7 | ,
8 | document.querySelector('#root')
9 | )
10 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-07/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-07/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/react/react-tuts/lesson-07/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-tuts/lesson-07/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-07/src/components/Like/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | export default class Like extends Component {
4 | constructor () {
5 | super()
6 | this.state = {
7 | isLiked: false
8 | }
9 | }
10 |
11 | handleLikedClick = () => {
12 | this.setState((prevState) => {
13 | return {
14 | isLiked: !prevState.isLiked
15 | }
16 | })
17 | }
18 |
19 | render() {
20 | return (
21 |
22 |
23 | {
24 | this.state.isLiked ? '取消 ❤️' : '喜欢 🖤'
25 | }
26 |
27 |
28 | )
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-07/src/components/TodoHeader/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 |
4 | export default function TodoHeader(props) {
5 | return (
6 | <>
7 |
8 | {props.children}
9 |
10 | {props.desc}
11 | >
12 | )
13 | }
14 |
15 | TodoHeader.propTypes = {
16 | desc: PropTypes.string.isRequired
17 | }
18 | TodoHeader.defaultProps = {
19 | desc: '如果还有明天'
20 | }
21 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-07/src/components/index.js:
--------------------------------------------------------------------------------
1 | // import TodoHeader from './TodoHeader'
2 | // import TodoInput from './TodoInput'
3 | // import TodoList from './TodoList'
4 |
5 | // export {
6 | // TodoHeader,
7 | // TodoInput,
8 | // TodoList
9 | // }
10 |
11 | export { default as TodoHeader } from './TodoHeader'
12 | export { default as TodoInput } from './TodoInput'
13 | export { default as TodoList } from './TodoList'
14 | export { default as Like } from './Like'
--------------------------------------------------------------------------------
/react/react-tuts/lesson-07/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { render } from 'react-dom'
3 |
4 | import App from './App'
5 |
6 | render(
7 | ,
8 | document.querySelector('#root')
9 | )
10 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-08/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-08/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/react/react-tuts/lesson-08/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-tuts/lesson-08/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-08/src/components/Like/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | export default class Like extends Component {
4 | constructor () {
5 | super()
6 | this.state = {
7 | isLiked: false
8 | }
9 | }
10 |
11 | handleLikedClick = () => {
12 | this.setState((prevState) => {
13 | return {
14 | isLiked: !prevState.isLiked
15 | }
16 | })
17 | }
18 |
19 | render() {
20 | return (
21 |
22 |
23 | {
24 | this.state.isLiked ? '取消 ❤️' : '喜欢 🖤'
25 | }
26 |
27 |
28 | )
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-08/src/components/TodoHeader/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import PropTypes from 'prop-types'
3 |
4 | export default function TodoHeader(props) {
5 | return (
6 | <>
7 |
8 | {props.children}
9 |
10 | {props.desc}
11 | >
12 | )
13 | }
14 |
15 | TodoHeader.propTypes = {
16 | desc: PropTypes.string.isRequired
17 | }
18 | TodoHeader.defaultProps = {
19 | desc: '如果还有明天'
20 | }
21 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-08/src/components/index.js:
--------------------------------------------------------------------------------
1 | // import TodoHeader from './TodoHeader'
2 | // import TodoInput from './TodoInput'
3 | // import TodoList from './TodoList'
4 |
5 | // export {
6 | // TodoHeader,
7 | // TodoInput,
8 | // TodoList
9 | // }
10 |
11 | export { default as TodoHeader } from './TodoHeader'
12 | export { default as TodoInput } from './TodoInput'
13 | export { default as TodoList } from './TodoList'
14 | export { default as Like } from './Like'
--------------------------------------------------------------------------------
/react/react-tuts/lesson-08/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { render } from 'react-dom'
3 |
4 | import App from './App'
5 |
6 | // 如果想要全局的扩展React.Component的prototype,比如,想把ajax的方法全局挂载组件的this上,就可以使用下面的方式
7 |
8 | // 引入所有的ajax请求
9 | // import * as services from './services'
10 | // 在prototype上挂载一个叫http的东西,然后就可以在组件内部通过this.http.方法名来执行一些操作
11 | // React.Component.prototype.http = services
12 |
13 | render(
14 | ,
15 | document.querySelector('#root')
16 | )
17 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-08/src/services/apis.js:
--------------------------------------------------------------------------------
1 | export default {
2 | baseURL: 'https://jsonplaceholder.typicode.com',
3 | // 获取todos的接口
4 | todos: '/todos'
5 | }
--------------------------------------------------------------------------------
/react/react-tuts/lesson-08/src/services/index.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios'
2 |
3 | import apis from './apis'
4 |
5 | const ajax = axios.create({
6 | baseURL: apis.baseURL
7 | })
8 |
9 | // 在这里还会去做一些全局的拦截器处理
10 |
11 | export const getTodos = () => {
12 | return ajax.get(apis.todos)
13 | }
--------------------------------------------------------------------------------
/react/react-tuts/lesson-09/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-09/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-tuts",
3 | "version": "0.1.0",
4 | "private": true,
5 | "dependencies": {
6 | "react": "^16.8.6",
7 | "react-dom": "^16.8.6",
8 | "react-scripts": "3.0.1"
9 | },
10 | "scripts": {
11 | "start": "react-scripts start",
12 | "build": "react-scripts build",
13 | "test": "react-scripts test",
14 | "eject": "react-scripts eject"
15 | },
16 | "eslintConfig": {
17 | "extends": "react-app"
18 | },
19 | "browserslist": {
20 | "production": [
21 | ">0.2%",
22 | "not dead",
23 | "not op_mini all"
24 | ],
25 | "development": [
26 | "last 1 chrome version",
27 | "last 1 firefox version",
28 | "last 1 safari version"
29 | ]
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-09/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/react/react-tuts/lesson-09/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-tuts/lesson-09/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-10/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-10/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/react/react-tuts/lesson-10/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-tuts/lesson-10/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-10/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | import {
4 | CountBtn,
5 | Counter
6 | } from './components'
7 |
8 | export default class App extends Component {
9 | render () {
10 | return (
11 | <>
12 | -
13 |
14 | +
15 | >
16 | )
17 | }
18 | }
--------------------------------------------------------------------------------
/react/react-tuts/lesson-10/src/components/CountBtn/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { CounterConsumer } from '../../counterStore'
3 | export default class CountBtn extends Component {
4 | render () {
5 | return (
6 |
7 | {
8 | ({onIncrementCount, onDecrementCount}) => {
9 | const handler = this.props.type === 'increment' ? onIncrementCount : onDecrementCount
10 | return
11 | }
12 | }
13 |
14 | )
15 | }
16 | }
--------------------------------------------------------------------------------
/react/react-tuts/lesson-10/src/components/Counter/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { CounterConsumer } from '../../counterStore'
3 |
4 | // 定义一个Counter组件
5 | export default class Counter extends Component {
6 | render () {
7 | return (
8 | // 使用CounterConsumer来接收count,
9 |
10 | {
11 | // 注意!注意!注意! Consumer的children必须是一个方法, 这个方法有一个参数,这个参数就是Provider的value
12 | ({ count }) => {
13 | return {count}
14 | }
15 | }
16 |
17 | )
18 | }
19 | }
--------------------------------------------------------------------------------
/react/react-tuts/lesson-10/src/components/index.js:
--------------------------------------------------------------------------------
1 | export { default as Counter } from './Counter'
2 | export { default as CountBtn } from './CountBtn'
--------------------------------------------------------------------------------
/react/react-tuts/lesson-10/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { render } from 'react-dom'
3 | import { CounterProvider } from './counterStore'
4 | import App from './App'
5 |
6 | render(
7 |
8 |
9 | ,
10 | document.querySelector('#root')
11 | )
--------------------------------------------------------------------------------
/react/react-tuts/lesson-11/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-11/config-overrides.js:
--------------------------------------------------------------------------------
1 | // module.exports = (config) => {
2 | // // 如果没有使用customize-cra,就在这里可以对config进行配置
3 | // return config
4 | // }
5 |
6 | const { override, addDecoratorsLegacy } = require('customize-cra')
7 |
8 | module.exports = override(
9 | addDecoratorsLegacy()
10 | )
--------------------------------------------------------------------------------
/react/react-tuts/lesson-11/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/react/react-tuts/lesson-11/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-tuts/lesson-11/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-11/src/Another.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import withCopyright from './withCopyright';
3 |
4 | @withCopyright
5 | class Another extends Component {
6 | render() {
7 | return (
8 |
9 | Another {this.props.name}
10 |
11 | )
12 | }
13 | }
14 |
15 | export default Another
16 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-11/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import Another from './Another'
3 | class App extends Component {
4 | render() {
5 | return (
6 |
10 | )
11 | }
12 | }
13 |
14 | export default App
15 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-11/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { render } from 'react-dom'
3 |
4 | import App from './App'
5 |
6 | render(
7 | ,
8 | document.querySelector('#root')
9 | )
--------------------------------------------------------------------------------
/react/react-tuts/lesson-11/src/withCopyright.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | const withCopyright = (YourComponent) => {
4 | return class WithCopyright extends Component {
5 | render() {
6 | return (
7 | <>
8 |
9 | © 2019 千锋教育
10 | >
11 | )
12 | }
13 | }
14 | }
15 |
16 | export default withCopyright
--------------------------------------------------------------------------------
/react/react-tuts/lesson-12/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-12/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/react/react-tuts/lesson-12/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-tuts/lesson-12/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-12/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | import {
4 | CartList
5 | } from './components'
6 |
7 | export default class App extends Component {
8 | render() {
9 | return (
10 |
11 |
12 |
13 | )
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-12/src/actions/actionType.js:
--------------------------------------------------------------------------------
1 | export default {
2 | CART_AMOUNT_INCREMENT: 'CART_AMOUNT_INCREMENT',
3 | CART_AMOUNT_DECREMENT: 'CART_AMOUNT_DECREMENT'
4 | }
--------------------------------------------------------------------------------
/react/react-tuts/lesson-12/src/actions/cart.js:
--------------------------------------------------------------------------------
1 | import actionType from './actionType'
2 |
3 | export const increment = (id) => {
4 | return {
5 | type: actionType.CART_AMOUNT_INCREMENT,
6 | payload: {
7 | id
8 | }
9 | }
10 | }
11 |
12 | export const decrement = (id) => {
13 | return {
14 | type: actionType.CART_AMOUNT_DECREMENT,
15 | payload: {
16 | id
17 | }
18 | }
19 | }
--------------------------------------------------------------------------------
/react/react-tuts/lesson-12/src/components/index.js:
--------------------------------------------------------------------------------
1 | export { default as CartList } from './CartList'
--------------------------------------------------------------------------------
/react/react-tuts/lesson-12/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { render } from 'react-dom'
3 |
4 | import App from './App'
5 | import store from './store'
6 |
7 | render(
8 | ,
9 | document.querySelector('#root')
10 | )
--------------------------------------------------------------------------------
/react/react-tuts/lesson-12/src/reducers/index.js:
--------------------------------------------------------------------------------
1 | import { combineReducers } from 'redux'
2 | import cart from './cart'
3 |
4 | export default combineReducers({
5 | cart
6 | })
7 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-12/src/store.js:
--------------------------------------------------------------------------------
1 | import { createStore } from 'redux'
2 |
3 | import rootReducer from './reducers'
4 |
5 | export default createStore(rootReducer)
--------------------------------------------------------------------------------
/react/react-tuts/lesson-13/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-13/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/react/react-tuts/lesson-13/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-tuts/lesson-13/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-13/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | import {
4 | CartList
5 | } from './components'
6 |
7 | export default class App extends Component {
8 | render() {
9 | return (
10 |
11 |
12 |
13 | )
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-13/src/actions/actionType.js:
--------------------------------------------------------------------------------
1 | export default {
2 | CART_AMOUNT_INCREMENT: 'CART_AMOUNT_INCREMENT',
3 | CART_AMOUNT_DECREMENT: 'CART_AMOUNT_DECREMENT'
4 | }
--------------------------------------------------------------------------------
/react/react-tuts/lesson-13/src/actions/cart.js:
--------------------------------------------------------------------------------
1 | import actionType from './actionType'
2 |
3 | // action有两种写法
4 |
5 | // 第一种写成一个对象,这是标准的action, 但是,问题是不方便传递动态参数
6 | // export const increment = {
7 | // type: actionType.CART_AMOUNT_INCREMENT,
8 | // payload: {
9 | // id: 123
10 | // }
11 | // }
12 |
13 | // 在工作中,常用的一种方式是使用actionCreator, 它是一个方法,返回一个对象,这个对象才是真正的action
14 | export const increment = (id) => {
15 | return {
16 | type: actionType.CART_AMOUNT_INCREMENT,
17 | payload: {
18 | id
19 | }
20 | }
21 | }
22 |
23 | export const decrement = (id) => {
24 | return {
25 | type: actionType.CART_AMOUNT_DECREMENT,
26 | payload: {
27 | id
28 | }
29 | }
30 | }
--------------------------------------------------------------------------------
/react/react-tuts/lesson-13/src/components/index.js:
--------------------------------------------------------------------------------
1 | export { default as CartList } from './CartList'
--------------------------------------------------------------------------------
/react/react-tuts/lesson-13/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { render } from 'react-dom'
3 |
4 | // Provider是react-redux提供的一个组件
5 | import { Provider } from 'react-redux'
6 |
7 | import App from './App'
8 | import store from './store'
9 |
10 | render(
11 | // 一般就直接把这个组件放在应用程序的最顶层,这个组件必须有一个store属性,这个store属性的值就是咱们创建的那个store
12 | // 只要在最外层包裹了这个Provider, 那么所有后代组件都可以使用Redux.connect做连接
13 |
14 |
15 | ,
16 | document.querySelector('#root')
17 | )
--------------------------------------------------------------------------------
/react/react-tuts/lesson-13/src/reducers/index.js:
--------------------------------------------------------------------------------
1 | // 在实际的项目中,由于只有单一的store, 但是状态会有很多分类,所以我们需要划分reducer, createStore的参数又只接收一个reducer, 所以,redux比较聪明的提供了一个用于合并多个reducer的方法。注意:不要手动合并
2 | import { combineReducers } from 'redux'
3 |
4 | // 引入cart reducer, 如果有多个,继续引入
5 | import cart from './cart'
6 |
7 | // 导出合并后的reducer
8 | export default combineReducers({
9 | // 把多个reducer做为combineReducers对象参数传入, 在外部就可以通过store.getState().cart来获取到cartReducer里面的state
10 | cart
11 | })
12 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-13/src/store.js:
--------------------------------------------------------------------------------
1 | // createStore是redux提供的一个用于创建store的方法,这个原理里已经讲到过
2 | import { createStore } from 'redux'
3 |
4 | // 引入全并后的reducer
5 | import rootReducer from './reducers'
6 |
7 | // createStore的第一个参数必须是一个reducer,如果是多个,请在reducers目录下先使用combineReducers全并之后再导出
8 | export default createStore(rootReducer)
--------------------------------------------------------------------------------
/react/react-tuts/lesson-14/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-14/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/react/react-tuts/lesson-14/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-tuts/lesson-14/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-14/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | import {
4 | CartList
5 | } from './components'
6 |
7 | export default class App extends Component {
8 | render() {
9 | return (
10 |
11 |
12 |
13 | )
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-14/src/actions/actionType.js:
--------------------------------------------------------------------------------
1 | export default {
2 | CART_AMOUNT_INCREMENT: 'CART_AMOUNT_INCREMENT',
3 | CART_AMOUNT_DECREMENT: 'CART_AMOUNT_DECREMENT'
4 | }
--------------------------------------------------------------------------------
/react/react-tuts/lesson-14/src/components/index.js:
--------------------------------------------------------------------------------
1 | export { default as CartList } from './CartList'
--------------------------------------------------------------------------------
/react/react-tuts/lesson-14/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { render } from 'react-dom'
3 |
4 | // Provider是react-redux提供的一个组件
5 | import { Provider } from 'react-redux'
6 |
7 | import App from './App'
8 | import store from './store'
9 |
10 | render(
11 | // 一般就直接把这个组件放在应用程序的最顶层,这个组件必须有一个store属性,这个store属性的值就是咱们创建的那个store
12 | // 只要在最外层包裹了这个Provider, 那么所有后代组件都可以使用Redux.connect做连接
13 |
14 |
15 | ,
16 | document.querySelector('#root')
17 | )
--------------------------------------------------------------------------------
/react/react-tuts/lesson-14/src/reducers/index.js:
--------------------------------------------------------------------------------
1 | // 在实际的项目中,由于只有单一的store, 但是状态会有很多分类,所以我们需要划分reducer, createStore的参数又只接收一个reducer, 所以,redux比较聪明的提供了一个用于合并多个reducer的方法。注意:不要手动合并
2 | import { combineReducers } from 'redux'
3 |
4 | // 引入cart reducer, 如果有多个,继续引入
5 | import cart from './cart'
6 |
7 | // 导出合并后的reducer
8 | export default combineReducers({
9 | // 把多个reducer做为combineReducers对象参数传入, 在外部就可以通过store.getState().cart来获取到cartReducer里面的state
10 | cart
11 | })
12 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-14/src/store.js:
--------------------------------------------------------------------------------
1 | // createStore是redux提供的一个用于创建store的方法,这个原理里已经讲到过
2 | import { createStore, applyMiddleware } from 'redux'
3 |
4 | import thunk from 'redux-thunk'
5 |
6 | // 引入全并后的reducer
7 | import rootReducer from './reducers'
8 |
9 | // createStore的第一个参数必须是一个reducer,如果是多个,请在reducers目录下先使用combineReducers全并之后再导出
10 | export default createStore(
11 | rootReducer,
12 | applyMiddleware(thunk)
13 | )
--------------------------------------------------------------------------------
/react/react-tuts/lesson-15/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-15/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/react/react-tuts/lesson-15/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-tuts/lesson-15/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-15/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | import { BlogList } from './components'
4 |
5 | export default class App extends Component {
6 | render() {
7 | return (
8 |
9 |
10 |
11 | )
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-15/src/actions/actionTypes.js:
--------------------------------------------------------------------------------
1 | export default {
2 | START_FETCH_BLOG_LIST: 'START_FETCH_BLOG_LIST',
3 | FETCH_BLOG_LIST_SUCCESS: 'FETCH_BLOG_LIST_SUCCESS',
4 | FETCH_BLOG_LIST_FAILED: 'FETCH_BLOG_LIST_FAILED',
5 | }
--------------------------------------------------------------------------------
/react/react-tuts/lesson-15/src/components/BlogList/BlogItem.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | // 实际上这是一个展示组件(Dumb/Presentational Components)
3 | export default function BlogItem(props) {
4 | return (
5 |
6 | {props.title}
7 | {props.body}
8 |
9 | )
10 | }
11 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-15/src/components/index.js:
--------------------------------------------------------------------------------
1 | export { default as BlogList } from './BlogList/BlogList'
--------------------------------------------------------------------------------
/react/react-tuts/lesson-15/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { render } from 'react-dom'
3 | import { Provider } from 'react-redux'
4 | import App from './App'
5 | import store from './store'
6 | render(
7 |
8 |
9 | ,
10 | document.querySelector('#root')
11 | )
--------------------------------------------------------------------------------
/react/react-tuts/lesson-15/src/reducers/index.js:
--------------------------------------------------------------------------------
1 | import { combineReducers } from 'redux'
2 | import blog from './blog'
3 |
4 | export default combineReducers({
5 | blog
6 | })
--------------------------------------------------------------------------------
/react/react-tuts/lesson-15/src/services/index.js:
--------------------------------------------------------------------------------
1 | import axios from 'axios'
2 |
3 | const ajax = axios.create({
4 | baseURL: 'http://jsonplaceholder.typicode.com'
5 | })
6 |
7 | export const getPosts = () => {
8 | return ajax.get('/posts')
9 | }
--------------------------------------------------------------------------------
/react/react-tuts/lesson-15/src/store.js:
--------------------------------------------------------------------------------
1 | import { createStore, applyMiddleware } from 'redux'
2 |
3 | import thunk from 'redux-thunk'
4 |
5 | import rootReducer from './reducers'
6 |
7 | export default createStore(
8 | rootReducer,
9 | applyMiddleware(thunk)
10 | )
--------------------------------------------------------------------------------
/react/react-tuts/lesson-16/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-16/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/react/react-tuts/lesson-16/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-tuts/lesson-16/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-16/src/components/BackHome/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | import { withRouter } from 'react-router-dom'
4 |
5 | class BackHome extends Component {
6 | goHome = () => {
7 | // this.props.history.push('/home')
8 | this.props.history.push({
9 | pathname: '/home',
10 | state: {
11 | id: this.props.match.params.id
12 | }
13 | })
14 | }
15 | render() {
16 | console.log(this.props)
17 | return (
18 |
19 | )
20 | }
21 | }
22 | export default withRouter(BackHome)
--------------------------------------------------------------------------------
/react/react-tuts/lesson-16/src/components/index.js:
--------------------------------------------------------------------------------
1 | export { default as BackHome } from './BackHome'
--------------------------------------------------------------------------------
/react/react-tuts/lesson-16/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 | import { render } from 'react-dom'
3 |
4 | import { BrowserRouter as Router, Route } from 'react-router-dom'
5 |
6 | import App from './App'
7 |
8 | render(
9 |
10 |
11 | ,
12 | document.querySelector('#root')
13 | )
--------------------------------------------------------------------------------
/react/react-tuts/lesson-16/src/views/Artical/ArticalDetail.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import { BackHome } from '../../components'
3 | export default class ArticalDetail extends Component {
4 | // goHome = () => {
5 | // // this.props.history.push('/home')
6 | // this.props.history.push({
7 | // pathname: '/home',
8 | // state: {
9 | // id: this.props.match.params.id
10 | // }
11 | // })
12 | // }
13 | render() {
14 | return (
15 |
16 | 文章详情 {this.props.match.params.id}
17 |
18 |
19 | )
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-16/src/views/Artical/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 | import {
3 | Link
4 | } from 'react-router-dom'
5 | export default class Artical extends Component {
6 | render() {
7 | return (
8 |
9 | 文章一
10 | 文章二
16 |
17 | )
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-16/src/views/Home/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | export default class Home extends Component {
4 | render() {
5 | console.log(this.props)
6 | return (
7 |
8 | 首页
9 |
10 | )
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-16/src/views/NotFound/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | export default class NotFound extends Component {
4 | render() {
5 | return (
6 |
7 | 404
8 |
9 | )
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-16/src/views/Users/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | export default class Users extends Component {
4 | render() {
5 | return (
6 |
7 | users
8 |
9 | )
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-16/src/views/index.js:
--------------------------------------------------------------------------------
1 | export { default as Home } from './Home'
2 | export { default as Artical } from './Artical'
3 | export { default as ArticalDetail } from './Artical/ArticalDetail'
4 | export { default as Users } from './Users'
5 | export { default as NotFound } from './NotFound'
--------------------------------------------------------------------------------
/react/react-tuts/lesson-17/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-17/config-overrides.js:
--------------------------------------------------------------------------------
1 | const { override, fixBabelImports, addLessLoader } = require('customize-cra')
2 | const theme = require('./theme')
3 | module.exports = override(
4 | fixBabelImports('import', {
5 | libraryName: 'antd',
6 | libraryDirectory: 'es',
7 | style: true,
8 | }),
9 | addLessLoader({
10 | javascriptEnabled: true,
11 | modifyVars: theme,
12 | })
13 | )
--------------------------------------------------------------------------------
/react/react-tuts/lesson-17/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/react/react-tuts/lesson-17/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-tuts/lesson-17/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/lesson-17/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import zhCN from 'antd/lib/locale-provider/zh_CN';
4 | // ConfigProvider 目前还不成熟
5 | // https://github.com/ant-design/ant-design/issues?utf8=%E2%9C%93&q=ConfigProvider
6 | import { LocaleProvider, ConfigProvider } from 'antd'
7 | import App from './App';
8 |
9 | ReactDOM.render(
10 |
11 |
12 | ,
13 | document.getElementById('root')
14 | )
--------------------------------------------------------------------------------
/react/react-tuts/lesson-17/theme.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | '@primary-color': '#090'
3 | }
--------------------------------------------------------------------------------
/react/react-tuts/mobx/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-tuts/mobx/config-overrides.js:
--------------------------------------------------------------------------------
1 | const { override, addDecoratorsLegacy } = require('customize-cra')
2 | module.exports = override(
3 | addDecoratorsLegacy()
4 | )
--------------------------------------------------------------------------------
/react/react-tuts/mobx/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/react/react-tuts/mobx/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-tuts/mobx/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/mobx/src/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | import {
4 | inject,
5 | observer
6 | } from 'mobx-react'
7 | import {
8 | CounterBtn,
9 | CounterDisplay
10 | } from './components'
11 |
12 | @inject('counter')
13 | @observer
14 | class App extends Component {
15 | render() {
16 | console.log(this.props)
17 | return (
18 |
19 | -
20 |
21 | +
22 |
23 | )
24 | }
25 | }
26 |
27 | export default App
28 |
--------------------------------------------------------------------------------
/react/react-tuts/mobx/src/components/CounterBtn/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | export default class CounterBtn extends Component {
4 | render() {
5 | return (
6 |
7 | )
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/react/react-tuts/mobx/src/components/index.js:
--------------------------------------------------------------------------------
1 | export { default as CounterBtn } from './CounterBtn'
2 | export { default as CounterDisplay } from './CounterDisplay'
--------------------------------------------------------------------------------
/react/react-tuts/mobx/src/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import ReactDOM from 'react-dom';
3 | import { Provider } from 'mobx-react'
4 | import App from './App';
5 |
6 | import counterStore from './store'
7 |
8 | ReactDOM.render(
9 |
10 |
11 | ,
12 | document.getElementById('root')
13 | );
14 |
--------------------------------------------------------------------------------
/react/react-tuts/mobx/src/store/index.js:
--------------------------------------------------------------------------------
1 | import { observable, computed, action } from 'mobx'
2 |
3 | class Counter {
4 | name = 'Counter App'
5 | @observable count = 100
6 | @computed get doubleCount() {
7 | return this.count * 2
8 | }
9 | @action.bound increment() {
10 | this.count += 1
11 | }
12 | @action.bound decrement() {
13 | this.count -= 1
14 | }
15 | }
16 |
17 | const counterStore = new Counter()
18 |
19 | export default counterStore
--------------------------------------------------------------------------------
/react/react-tuts/react-admin/.gitignore:
--------------------------------------------------------------------------------
1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2 |
3 | # dependencies
4 | /node_modules
5 | /.pnp
6 | .pnp.js
7 |
8 | # testing
9 | /coverage
10 |
11 | # production
12 | /build
13 |
14 | # misc
15 | .DS_Store
16 | .env.local
17 | .env.development.local
18 | .env.test.local
19 | .env.production.local
20 |
21 | npm-debug.log*
22 | yarn-debug.log*
23 | yarn-error.log*
24 |
--------------------------------------------------------------------------------
/react/react-tuts/react-admin/config-overrides.js:
--------------------------------------------------------------------------------
1 | /*
2 | * @file config-overrides.js
3 | * @author Leo Zhou(zhouyong@1000phone.com)
4 | * 基于customzie和react-app-rewired的定制化配置文件
5 | *
6 | */
7 |
8 | // 从customize-cra引入一些相关的方法
9 | const {
10 | override,
11 | addLessLoader,
12 | fixBabelImports,
13 | addDecoratorsLegacy
14 | } = require('customize-cra')
15 |
16 | const modifyVars = require('./lessVars')
17 |
18 | module.exports = override(
19 | addLessLoader({
20 | javascriptEnabled: true,
21 | modifyVars
22 | }),
23 | addDecoratorsLegacy(),
24 | fixBabelImports('import', {
25 | libraryName: 'antd',
26 | libraryDirectory: 'es',
27 | style: true,
28 | }),
29 | )
--------------------------------------------------------------------------------
/react/react-tuts/react-admin/lessVars.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | '@primary-color': '#1890ff', // 全局主色
3 | '@link-color': '#1890ff', // 链接色
4 | '@success-color': '#52c41a', // 成功色
5 | '@warning-color': '#faad14', // 警告色
6 | '@error-color': '#f5222d', // 错误色
7 | '@font-size-base': '14px', // 主字号
8 | '@heading-color': 'rgba(0, 0, 0, 0.85)', // 标题色
9 | '@text-color': 'rgba(0, 0, 0, 0.65)', // 主文本色
10 | '@text-color-secondary ': 'rgba(0, 0, 0, .45)', // 次文本色
11 | '@disabled-color ': 'rgba(0, 0, 0, .25)', // 失效色
12 | '@border-radius-base': '4px', // 组件/浮层圆角
13 | '@border-color-base': '#d9d9d9', // 边框色
14 | '@box-shadow-base': '0 2px 8px rgba(0, 0, 0, 0.15)', // 浮层阴影
15 | }
--------------------------------------------------------------------------------
/react/react-tuts/react-admin/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/react/react-tuts/react-admin/public/favicon.ico
--------------------------------------------------------------------------------
/react/react-tuts/react-admin/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "React App",
3 | "name": "Create React App Sample",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | }
10 | ],
11 | "start_url": ".",
12 | "display": "standalone",
13 | "theme_color": "#000000",
14 | "background_color": "#ffffff"
15 | }
16 |
--------------------------------------------------------------------------------
/react/react-tuts/react-admin/src/actions/actionTypes.js:
--------------------------------------------------------------------------------
1 | export default {
2 | MARK_NOTIFICATION_AS_READ_BY_ID: 'MARK_NOTIFICATION_AS_READ_BY_ID',
3 | MARK_ALL_NOTIFICATIONS_AS_READ: 'MARK_ALL_NOTIFICATIONS_AS_READ',
4 | START_NOTIFICATION_POST: 'START_NOTIFICATION_POST',
5 | FINISH_NOTIFICATION_POST: 'FINISH_NOTIFICATION_POST',
6 | RECIVED_NOTIFICATIONS: 'RECIVED_NOTIFICATIONS',
7 | START_LOGIN: 'START_LOGIN',
8 | LOGIN_SUCCESS: 'LOGIN_SUCCESS',
9 | LOGIN_FAILED: 'LOGIN_FAILED',
10 | CHANGE_AVATAR: 'CHANGE_AVATAR'
11 | }
--------------------------------------------------------------------------------
/react/react-tuts/react-admin/src/components/Frame/frame.less:
--------------------------------------------------------------------------------
1 | .qf-header {
2 | padding: 0 16px;
3 | background-color: #fff;
4 | border-bottom: 1px solid #dedede;
5 | display: flex;
6 | .qf-logo {
7 | height: 48px;
8 | flex: 1;
9 | img {
10 | max-height: 100%;
11 | }
12 | }
13 | }
--------------------------------------------------------------------------------
/react/react-tuts/react-admin/src/components/Frame/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/react/react-tuts/react-admin/src/components/Frame/logo.png
--------------------------------------------------------------------------------
/react/react-tuts/react-admin/src/components/Loading/index.js:
--------------------------------------------------------------------------------
1 | import React from 'react'
2 |
3 | export default function Loading() {
4 | return (
5 |
6 | loading…
7 |
8 | )
9 | }
10 |
--------------------------------------------------------------------------------
/react/react-tuts/react-admin/src/components/index.js:
--------------------------------------------------------------------------------
1 | export { default as Loading } from './Loading'
2 | export { default as Frame } from './Frame'
--------------------------------------------------------------------------------
/react/react-tuts/react-admin/src/index.less:
--------------------------------------------------------------------------------
1 | @bgc: #f2f2f2;
2 | html,
3 | body {
4 | height: 100%;
5 | }
6 | #root {
7 | height: 100%;
8 | }
9 | body {
10 | background-color: @bgc;
11 | }
--------------------------------------------------------------------------------
/react/react-tuts/react-admin/src/reducers/index.js:
--------------------------------------------------------------------------------
1 | import { combineReducers } from 'redux'
2 |
3 | import notifications from './notifications'
4 | import user from './user'
5 |
6 | export default combineReducers({
7 | notifications,
8 | user
9 | })
10 |
--------------------------------------------------------------------------------
/react/react-tuts/react-admin/src/store.js:
--------------------------------------------------------------------------------
1 | import { createStore, applyMiddleware } from 'redux'
2 | import thunk from 'redux-thunk'
3 |
4 | import rootReducer from './reducers'
5 |
6 | export default createStore(
7 | rootReducer,
8 | applyMiddleware(thunk)
9 | )
--------------------------------------------------------------------------------
/react/react-tuts/react-admin/src/views/Article/edit.less:
--------------------------------------------------------------------------------
1 | .qf-editor {
2 | position: relative;
3 | z-index: 0;
4 |
5 | .w-e-toolbar {
6 | flex-wrap: wrap;
7 | }
8 | }
--------------------------------------------------------------------------------
/react/react-tuts/react-admin/src/views/Dashboard/dashboard.less:
--------------------------------------------------------------------------------
1 | .qf-gutter-box {
2 | height: 120px;
3 | text-align: center;
4 | line-height: 120px;
5 | color: #fff;
6 | border-radius: 6px;
7 | }
8 |
--------------------------------------------------------------------------------
/react/react-tuts/react-admin/src/views/Login/login.less:
--------------------------------------------------------------------------------
1 | .qf-login-wrapper {
2 | width: 500px;
3 | position: fixed;
4 | left: 50%;
5 | top: 50%;
6 | transform: translate3d(-50%, -50%, 0);
7 | margin-top: -30px;
8 | }
--------------------------------------------------------------------------------
/react/react-tuts/react-admin/src/views/NoAuth/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | export default class NoAuth extends Component {
4 | render() {
5 | return (
6 |
7 | 你没有权限查看此页面
8 |
9 | )
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/react/react-tuts/react-admin/src/views/NotFound/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | export default class NotFound extends Component {
4 | render() {
5 | return (
6 |
7 | 404
8 |
9 | )
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/react/react-tuts/react-admin/src/views/Settings/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react'
2 |
3 | export default class Settings extends Component {
4 | render() {
5 | return (
6 |
7 | 设置页
8 |
9 | )
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/shareByothers/FE/README.md:
--------------------------------------------------------------------------------
1 | ### 记录前端知识点
2 |
--------------------------------------------------------------------------------
/shareByothers/FE/网络协议.md:
--------------------------------------------------------------------------------
1 | ## 网络协议
2 |
3 | ### OSI与TCP/IP协议模型
4 |
5 | 
--------------------------------------------------------------------------------
/shareByothers/assets/README.md:
--------------------------------------------------------------------------------
1 | ### 此项目所需的静态资源存放目录
--------------------------------------------------------------------------------
/shareByothers/assets/img/browerRender.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/shareByothers/assets/img/browerRender.png
--------------------------------------------------------------------------------
/shareByothers/assets/img/event.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/shareByothers/assets/img/event.png
--------------------------------------------------------------------------------
/shareByothers/assets/img/js.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/shareByothers/assets/img/js.jpg
--------------------------------------------------------------------------------
/shareByothers/assets/img/prototype.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/shareByothers/assets/img/prototype.jpg
--------------------------------------------------------------------------------
/shareByothers/assets/img/react.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/shareByothers/assets/img/react.jpg
--------------------------------------------------------------------------------
/shareByothers/assets/img/reactLifecycle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/shareByothers/assets/img/reactLifecycle.png
--------------------------------------------------------------------------------
/shareByothers/assets/img/react_sc/FiberEl.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/shareByothers/assets/img/react_sc/FiberEl.png
--------------------------------------------------------------------------------
/shareByothers/assets/img/react_sc/FiberTree.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/shareByothers/assets/img/react_sc/FiberTree.jpg
--------------------------------------------------------------------------------
/shareByothers/assets/img/react_sc/createEl_babel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/shareByothers/assets/img/react_sc/createEl_babel.png
--------------------------------------------------------------------------------
/shareByothers/assets/img/react_sc/fiber-scheduler.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/shareByothers/assets/img/react_sc/fiber-scheduler.png
--------------------------------------------------------------------------------
/shareByothers/assets/img/redux.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/shareByothers/assets/img/redux.jpg
--------------------------------------------------------------------------------
/shareByothers/assets/img/task.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/shareByothers/assets/img/task.jpg
--------------------------------------------------------------------------------
/shareByothers/assets/img/xieyi.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/shareByothers/assets/img/xieyi.jpg
--------------------------------------------------------------------------------
/shareByothers/books/你不知道的JavaScript(上卷).pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/shareByothers/books/你不知道的JavaScript(上卷).pdf
--------------------------------------------------------------------------------
/shareByothers/books/你不知道的JavaScript(下卷).pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/shareByothers/books/你不知道的JavaScript(下卷).pdf
--------------------------------------------------------------------------------
/shareByothers/books/你不知道的JavaScript(中卷).pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/shareByothers/books/你不知道的JavaScript(中卷).pdf
--------------------------------------------------------------------------------
/shareByothers/git/README.md:
--------------------------------------------------------------------------------
1 | ### 获取本地SSH Key:
2 | ```sh
3 | ls ~/.ssh
4 |
5 | cat ~/.ssh/id_rsa.pub
6 | ```
7 |
8 | ### 在远程仓库的master分支基础上建立新分支:
9 | ```
10 | git checkout master -b dev
11 |
12 | git push origin dev
13 | ```
--------------------------------------------------------------------------------
/shareByothers/js/README.md:
--------------------------------------------------------------------------------
1 | ### 记录JS的知识点
--------------------------------------------------------------------------------
/shareByothers/react/README.md:
--------------------------------------------------------------------------------
1 | ### React 学习过程中的一些笔记, 包含:
2 |
3 | - React 知识点
4 | - Redux
5 | - Redux-saga
6 | - React源码学习( version: 16.6.1 )
--------------------------------------------------------------------------------
/ts/ts-axios/ts-axios-doc-master/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .DS_Store
3 | node_modules/
4 | dist
--------------------------------------------------------------------------------
/ts/ts-axios/ts-axios-doc-master/README.md:
--------------------------------------------------------------------------------
1 | # ts-axios-doc
2 |
3 | TypeScript 从零实现 axios 文档教材
4 |
5 | ## 启动电子书
6 |
7 | 首先 clone 本项目:
8 |
9 | ```bash
10 | git clone https://github.com/Suremotoo/ts-axios-doc.git
11 | ```
12 |
13 | 进入 `ts-axios-doc` 目录后安装项目依赖:
14 |
15 | ```bash
16 | npm install
17 | ```
18 |
19 | 安装依赖后运行电子书:
20 |
21 | ```bash
22 | npm run dev
23 | ```
24 |
25 | 浏览器打开 `http://localhost:8080/ts-axios/` 即可。
26 |
--------------------------------------------------------------------------------
/ts/ts-axios/ts-axios-doc-master/deploy.js:
--------------------------------------------------------------------------------
1 | const ghpages = require('gh-pages');
2 |
3 | ghpages.publish('dist', function (err) {
4 | debugger
5 | });
--------------------------------------------------------------------------------
/ts/ts-axios/ts-axios-doc-master/docs/.vuepress/public/interceptor.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/ts/ts-axios/ts-axios-doc-master/docs/.vuepress/public/interceptor.png
--------------------------------------------------------------------------------
/ts/ts-axios/ts-axios-doc-master/docs/.vuepress/public/ts-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/ts/ts-axios/ts-axios-doc-master/docs/.vuepress/public/ts-logo.png
--------------------------------------------------------------------------------
/ts/ts-axios/ts-axios-doc-master/docs/.vuepress/public/xsrf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/awesomezao/note/1f6f776cf89f10176cfb8f896df8d10f0d3fce7e/ts/ts-axios/ts-axios-doc-master/docs/.vuepress/public/xsrf.png
--------------------------------------------------------------------------------
/ts/ts-axios/ts-axios-doc-master/docs/README.md:
--------------------------------------------------------------------------------
1 | ---
2 | home: true
3 | heroImage: /ts-logo.png
4 | actionText: 开始学习 →
5 | actionLink: /chapter1/
6 | ---
7 |
--------------------------------------------------------------------------------
/ts/ts-axios/ts-axios-doc-master/docs/chapter1/install.md:
--------------------------------------------------------------------------------
1 | # 安装 TypeScript
2 |
3 | 命令行运行如下命令,全局安装 TypeScript:
4 |
5 | ```bash
6 | npm install -g typescript
7 | ```
8 |
9 | 安装完成后,在控制台运行如下命令,检查安装是否成功(3.x):
10 |
11 | ```bash
12 | tsc -V
13 | ```
14 |
15 | ## 插曲
16 |
17 | 在录制本视频的时候,TypeScript 的版本是 3.3.3333,很多同学看到这个版本号一定很好奇,我也一样,于是我去搜了一下,发现这个是 TypeScript 团队有意为之,详情可以参考这个 [issue](https://github.com/Microsoft/TypeScript/issues/30032)
18 |
--------------------------------------------------------------------------------
/ts/ts-axios/ts-axios-doc-master/docs/chapter11/preface.md:
--------------------------------------------------------------------------------
1 | # 前言
2 |
3 | 单元测试是前端一个很重要的方向,鉴别一个开源库是否靠谱的一个标准是它的单元测试是否完善。有了完整的单元测试,未来你去重构现有代码或者是增加新的需求都会有十足的把握不出现 regression bug。
4 |
5 | 在前面的章节,我们已经编写完成 ts-axios 库的代码,并通过 demo 的形式简单地对一些功能做了验证,但是 demo 可以走到的代码分支,覆盖的场景都是极其有限的。为了用更科学的手段保证我们代码的可靠性,我们需要去编写单元测试,并尽可能达到 99% 以上的测试覆盖率。
6 |
7 | 这门课我们会使用开源测试框架 [Jest](https://jestjs.io/en/),它是 Facebook 出品的一个测试框架,相对其他测试框架,它的一大特点就是内置了常用的测试工具,比如自带断言、测试覆盖率工具,实现了开箱即用。
8 |
9 | 由于时间有限,我不会带大家一行行手敲测试代码,但我会把所有的知识点和测试代码都带大家过一遍,确保大家都能够学会。但是我希望你们在学习的过程中,能自己手敲这些测试代码,这样有助于你们学习和巩固。
10 |
11 | 通过这一章节的学习,我希望你们能够学会使用 Jest 去对 JS 库或者是 TS 库编写单元测试,并能把所学应用到你们的实际项目中。给自己的代码添加完整的测试代码也是一个非常好的开发习惯,虽然枯燥但十分实用,如果养成这些好习惯会有助于提升你的行业竞争力,所以希望大家虽然把代码实现了,也不要太骄傲,耐心把单元测试写好。
12 |
13 | 那么接下来就让我们开启单元测试之旅。
14 |
15 |
--------------------------------------------------------------------------------
/ts/ts-axios/ts-axios-doc-master/docs/chapter3/require.md:
--------------------------------------------------------------------------------
1 | # 需求分析
2 |
3 | 接下来的章节,我们会使用 TypeScript 来重构 axios,重构之前,我们需要简单地做一些需求分析,看一下我们这次重构需要支持哪些 feature。
4 |
5 | ## Features
6 |
7 | - 在浏览器端使用 XMLHttpRequest 对象通讯
8 | - 支持 Promise API
9 | - 支持请求和响应的拦截器
10 | - 支持请求数据和响应数据的转换
11 | - 支持请求的取消
12 | - JSON 数据的自动转换
13 | - 客户端防止 XSRF
14 |
15 | 此外,我们还会支持一些 axios 库支持的一些其它的 feature。这里要注意的,我们这次重构不包括 axios 在 Node 中的实现,因为这部分我们在平时项目中应用的很少,还涉及到很多 Node.js 的知识,如果都讲的话,一是比较占用时间,另一个可能会喧宾夺主了。当然,这部分知识点我会根据同学们学习的反馈,如果大家很感兴趣想学习的话,我就作为课程的补充内容加到后期视频的扩展中,也当做课程的福利送给大家,所以大家务必要支持一下正版课程喔~
16 |
17 | 那么接下来我们就开始初始化项目吧!
18 |
19 |
--------------------------------------------------------------------------------
/ts/ts-axios/ts-axios-doc-master/examples/section2/index.js:
--------------------------------------------------------------------------------
1 | var __assign = (this && this.__assign) || function () {
2 | __assign = Object.assign || function(t) {
3 | for (var s, i = 1, n = arguments.length; i < n; i++) {
4 | s = arguments[i];
5 | for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6 | t[p] = s[p];
7 | }
8 | return t;
9 | };
10 | return __assign.apply(this, arguments);
11 | };
12 | var defaults = {
13 | food: 'spicy',
14 | price: '$10',
15 | ambiance: 'noisy'
16 | };
17 | var search = __assign({ food: 'rich' }, defaults);
18 | console.log(search);
19 |
--------------------------------------------------------------------------------
/ts/ts-axios/ts-axios-doc-master/examples/section2/index.ts:
--------------------------------------------------------------------------------
1 | let defaults = {
2 | food: 'spicy',
3 | price: '$10',
4 | ambiance: 'noisy'
5 | }
6 |
7 | let search = {food: 'rich', ...defaults}
8 |
9 | console.log(search)
--------------------------------------------------------------------------------
/ts/ts-axios/ts-axios-doc-master/examples/section3/index.ts:
--------------------------------------------------------------------------------
1 | class Control {
2 | private state: any
3 | }
4 |
5 | interface SelectableControl extends Control {
6 | select()
7 | }
8 |
9 | class Button extends Control implements SelectableControl {
10 | select() {
11 | }
12 | }
13 |
14 | class TextBox extends Control {
15 | select() {
16 | }
17 | }
18 |
19 | class ImageC implements SelectableControl{
20 | select() {}
21 | }
--------------------------------------------------------------------------------
/ts/ts-axios/ts-axios-doc-master/examples/section4/index.js:
--------------------------------------------------------------------------------
1 | var Greeter = /** @class */ (function () {
2 | function Greeter(message) {
3 | this.greeting = message;
4 | }
5 | Greeter.prototype.greet = function () {
6 | if (this.greeting) {
7 | return 'Hello, ' + this.greeting;
8 | }
9 | else {
10 | return Greeter.standardGreeting;
11 | }
12 | };
13 | Greeter.standardGreeting = 'Hello, there';
14 | return Greeter;
15 | }());
16 | var greeter;
17 | greeter = new Greeter();
18 | console.log(greeter.greet());
19 | var greeterMaker = Greeter;
20 | greeterMaker.standardGreeting = 'Hey there';
21 | var greeter2 = new greeterMaker();
22 | console.log(greeter2.greet());
23 |
--------------------------------------------------------------------------------
/ts/ts-axios/ts-axios-doc-master/examples/section4/index.ts:
--------------------------------------------------------------------------------
1 | class Greeter {
2 | static standardGreeting = 'Hello, there'
3 |
4 | greeting: string
5 |
6 | constructor(message?: string) {
7 | this.greeting = message
8 | }
9 |
10 | greet() {
11 | if (this.greeting) {
12 | return 'Hello, ' + this.greeting
13 | } else {
14 | return Greeter.standardGreeting
15 | }
16 | }
17 | }
18 |
19 | let greeter: Greeter
20 | greeter = new Greeter()
21 | console.log(greeter.greet())
22 |
23 | let greeterMaker: typeof Greeter = Greeter
24 | greeterMaker.standardGreeting = 'Hey there'
25 |
26 | let greeter2: Greeter = new greeterMaker()
27 | console.log(greeter2.greet())
--------------------------------------------------------------------------------
/ts/ts-axios/ts-axios-doc-master/examples/section6/index.ts:
--------------------------------------------------------------------------------
1 | class Animal {
2 | numLegs: number
3 | }
4 |
5 | class Bee extends Animal {
6 |
7 | }
8 |
9 | class Lion extends Animal {
10 |
11 | }
12 |
--------------------------------------------------------------------------------
/ts/ts-axios/ts-axios-doc-master/examples/section7/index.js:
--------------------------------------------------------------------------------
1 | function broken(name) {
2 | function postfix(epithet) {
3 | return name.charAt(0) + '. the ' + epithet; // error, 'name' 可能为 null
4 | }
5 | name = name || 'Bob';
6 | return postfix('great');
7 | }
8 | function fixed(name) {
9 | function postfix(epithet) {
10 | return name.charAt(0) + '. the ' + epithet; // ok
11 | }
12 | name = name || 'Bob';
13 | return postfix('great');
14 | }
15 | broken(null);
16 |
--------------------------------------------------------------------------------
/ts/ts-axios/ts-axios-doc-master/examples/section7/index.ts:
--------------------------------------------------------------------------------
1 | type Easing = 'ease-in' | 'ease-out' | 'ease-in-out'
2 |
3 | class UIElement {
4 | animate (dx: number, dy: number, easing: Easing) {
5 | if (easing === 'ease-in') {
6 | // ...
7 | } else if (easing === 'ease-out') {
8 | } else if (easing === 'ease-in-out') {
9 | } else {
10 | // error! 不能传入 null 或者 undefined.
11 | }
12 | }
13 | }
14 |
15 | let button = new UIElement()
16 | button.animate(0, 0, 'ease-in')
17 | button.animate(0, 0, 'uneasy') // error
18 |
--------------------------------------------------------------------------------
/ts/ts-axios/ts-axios-doc-master/examples/section8/index.js:
--------------------------------------------------------------------------------
1 | var UIElement = /** @class */ (function () {
2 | function UIElement() {
3 | }
4 | UIElement.prototype.animate = function (dx, dy, easing) {
5 | if (easing === 'ease-in') {
6 | // ...
7 | }
8 | else if (easing === 'ease-out') {
9 | }
10 | else if (easing === 'ease-in-out') {
11 | }
12 | else {
13 | }
14 | };
15 | return UIElement;
16 | }());
17 | var button = new UIElement();
18 | button.animate(0, 0, 'ease-in');
19 | button.animate(0, 0, null);
20 |
--------------------------------------------------------------------------------
/ts/ts-axios/ts-axios-doc-master/examples/section8/index.ts:
--------------------------------------------------------------------------------
1 | type Easing = 'ease-in' | 'ease-out' | 'ease-in-out'
2 |
3 | class UIElement {
4 | animate (dx: number, dy: number, easing: Easing) {
5 | if (easing === 'ease-in') {
6 | // ...
7 | } else if (easing === 'ease-out') {
8 | } else if (easing === 'ease-in-out') {
9 | } else {
10 |
11 | }
12 | }
13 | }
14 |
15 | let button = new UIElement()
16 | button.animate(0, 0, 'ease-in')
17 | button.animate(0, 0, 'uneasy')
--------------------------------------------------------------------------------
/ts/ts-axios/typescript-axios-master/.editorconfig:
--------------------------------------------------------------------------------
1 | #root = true
2 |
3 | [*]
4 | indent_style = space
5 | end_of_line = lf
6 | charset = utf-8
7 | trim_trailing_whitespace = true
8 | insert_final_newline = true
9 | max_line_length = 100
10 | indent_size = 2
11 |
12 | [*.md]
13 | trim_trailing_whitespace = false
14 |
--------------------------------------------------------------------------------
/ts/ts-axios/typescript-axios-master/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | coverage
3 | .nyc_output
4 | .DS_Store
5 | *.log
6 | .vscode
7 | .idea
8 | dist
9 | compiled
10 | .awcache
11 | .rpt2_cache
12 | docs
13 |
--------------------------------------------------------------------------------
/ts/ts-axios/typescript-axios-master/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 | cache:
3 | directories:
4 | - ~/.npm
5 | notifications:
6 | email: false
7 | node_js:
8 | - '10'
9 | - '11'
10 | - '8'
11 | - '6'
12 | script:
13 | - npm run test:prod && npm run build
14 | after_success:
15 | - npm run travis-deploy-once "npm run report-coverage"
16 | - if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then npm run travis-deploy-once "npm run deploy-docs"; fi
17 | - if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then npm run travis-deploy-once "npm run semantic-release"; fi
18 | branches:
19 | except:
20 | - /^v\d+\.\d+\.\d+$/
21 |
--------------------------------------------------------------------------------
/ts/ts-axios/typescript-axios-master/README.md:
--------------------------------------------------------------------------------
1 | ## 项目介绍
2 | [](https://www.npmjs.com/package/koa-router)
3 |
4 | 基于 TypeScript 从零重构axios。
5 |
6 |
7 | ## typescript-axios
8 | - 在浏览器端使用 XMLHttpRequest 对象通讯。
9 | - 支持 Promise API。
10 | - 支持请求和响应的拦截器。
11 | - 支持请求数据和响应数据的转换。
12 | - 支持请求的取消。
13 | - JSON 数据的自动转换。
14 | - 客户端防止 XSRF。
15 |
16 | ## 项目来源与正版教程
17 |
18 | - 请支持正版教程:[《基于TypeScript从零重构axios》](https://s.imooc.com/SwIaZGv), by 慕课网:黄轶老师。
19 |
--------------------------------------------------------------------------------
/ts/ts-axios/typescript-axios-master/examples/base/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Base example
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ts/ts-axios/typescript-axios-master/examples/error/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Error example
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ts/ts-axios/typescript-axios-master/examples/extend/app.ts:
--------------------------------------------------------------------------------
1 | import axios from '../../src/index'
2 |
3 | interface ResponseData {
4 | code: number
5 | result: T
6 | message: string
7 | }
8 |
9 | interface User {
10 | name: string
11 | age: number
12 | }
13 |
14 | function getUser() {
15 | return axios>('/extend/user')
16 | .then(res => res.data)
17 | .catch(err => console.error(err))
18 | }
19 |
20 |
21 | async function test() {
22 | const user = await getUser()
23 | if (user) {
24 | console.log(user.result.name)
25 | }
26 | }
27 |
28 | test()
29 |
--------------------------------------------------------------------------------
/ts/ts-axios/typescript-axios-master/examples/extend/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Extend example
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ts/ts-axios/typescript-axios-master/examples/global.css:
--------------------------------------------------------------------------------
1 | html, body {
2 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
3 | color: #2c3e50;
4 | }
5 |
6 | ul {
7 | line-height: 1.5em;
8 | padding-left: 1.5em;
9 | }
10 |
11 | a {
12 | color: #7f8c8d;
13 | text-decoration: none;
14 | }
15 |
16 | a:hover {
17 | color: #4fc08d;
18 | }
19 |
--------------------------------------------------------------------------------
/ts/ts-axios/typescript-axios-master/examples/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | ts-axios examples
6 |
7 |
8 |
9 | ts-axios examples
10 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/ts/ts-axios/typescript-axios-master/examples/simple/app.ts:
--------------------------------------------------------------------------------
1 | import axios from '../../src/index'
2 |
3 | axios({
4 | method: 'get',
5 | url: '/simple/get',
6 | params: {
7 | a: 1,
8 | b: 2
9 | }
10 | })
11 |
--------------------------------------------------------------------------------
/ts/ts-axios/typescript-axios-master/examples/simple/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Simple example
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/ts/ts-axios/typescript-axios-master/src/axios.ts:
--------------------------------------------------------------------------------
1 | import { AxiosInstance } from './types'
2 | import Axios from './core/Axios'
3 | import { extend } from './helper/util'
4 |
5 | function createInstance(): AxiosInstance {
6 | const context = new Axios()
7 | const instance = Axios.prototype.request.bind(context)
8 |
9 | extend(instance, context)
10 |
11 | return instance as AxiosInstance
12 | }
13 |
14 | const axios = createInstance()
15 |
16 | export default axios
17 |
--------------------------------------------------------------------------------
/ts/ts-axios/typescript-axios-master/src/helper/data.ts:
--------------------------------------------------------------------------------
1 | import { isPlainObject } from './util'
2 |
3 | export function transformRequest(data: any): any {
4 | if (isPlainObject(data)) {
5 | return JSON.stringify(data)
6 | }
7 |
8 | return data
9 | }
10 |
11 | // 处理响应data
12 | export function transformResponse(data: any): any {
13 | if (typeof data === 'string') {
14 | try {
15 | data = JSON.parse(data)
16 | } catch (e) {
17 | // do nothing
18 | }
19 | }
20 | return data
21 | }
22 |
--------------------------------------------------------------------------------
/ts/ts-axios/typescript-axios-master/src/helper/util.ts:
--------------------------------------------------------------------------------
1 | const toString = Object.prototype.toString
2 |
3 | // 判断是否为日期对象
4 | export function isDate(val: any): val is Date {
5 | return toString.call(val) === '[object Date]'
6 | }
7 |
8 | // 判断是否为对象
9 | export function isObject(val: any): val is Object {
10 | return val !== null && typeof val === 'object'
11 | }
12 |
13 | // 判断普通对象
14 | export function isPlainObject(val: any): val is Object {
15 | return toString.call(val) === '[object Object]'
16 | }
17 |
18 | export function extend(to: T, from: U): T & U {
19 | for (const key in from) {
20 | ;(to as T & U)[key] = from[key] as any
21 | }
22 | return to as T & U
23 | }
24 |
--------------------------------------------------------------------------------
/ts/ts-axios/typescript-axios-master/src/index.ts:
--------------------------------------------------------------------------------
1 | import axios from './axios'
2 |
3 | export * from './types'
4 |
5 | export default axios
6 |
--------------------------------------------------------------------------------
/ts/ts-axios/typescript-axios-master/test.js:
--------------------------------------------------------------------------------
1 | let values = []
2 | var val = ['baz', 'bar']
3 | var val2 = [{ id: 1, name: 'val1' }, { id: 2, name: 'val2' }]
4 | var key = ''
5 | if (Array.isArray(val2)) {
6 | values = val2
7 |
8 |
9 |
10 |
11 | } else {
12 | // 反之,直接放进入组里面
13 | // 为了下面进行处理为 日期或者对象 格式
14 | values = [val2]
15 | }
16 | console.log(values)
17 |
--------------------------------------------------------------------------------
/ts/ts-axios/typescript-axios-master/test/typescript-axios.test.ts:
--------------------------------------------------------------------------------
1 | import DummyClass from '../src/typescript-axios'
2 |
3 | /**
4 | * Dummy test
5 | */
6 | describe('Dummy test', () => {
7 | it('works if true is truthy', () => {
8 | expect(true).toBeTruthy()
9 | })
10 |
11 | it('DummyClass is instantiable', () => {
12 | expect(new DummyClass()).toBeInstanceOf(DummyClass)
13 | })
14 | })
15 |
--------------------------------------------------------------------------------
/ts/ts-axios/typescript-axios-master/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "moduleResolution": "node",
4 | "target": "es5",
5 | "module":"es2015",
6 | "lib": ["es2015", "es2016", "es2017", "dom"],
7 | "strict": true,
8 | "sourceMap": true,
9 | "declaration": true,
10 | "allowSyntheticDefaultImports": true,
11 | "experimentalDecorators": true,
12 | "emitDecoratorMetadata": true,
13 | "declarationDir": "dist/types",
14 | "outDir": "dist/lib",
15 | "typeRoots": [
16 | "node_modules/@types"
17 | ]
18 | },
19 | "include": [
20 | "src"
21 | ]
22 | }
23 |
--------------------------------------------------------------------------------
/ts/ts-axios/typescript-axios-master/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": [
3 | "tslint-config-standard",
4 | "tslint-config-prettier"
5 | ]
6 | }
--------------------------------------------------------------------------------
/设计模式/test.js:
--------------------------------------------------------------------------------
1 | var person = {
2 | name:'zao'
3 | }
4 | var arr = []
5 | var reg=/^a$/
6 | var zao=function (name) {
7 | this.name=name
8 | }
9 |
10 | var a=new zao()
11 | console.time()
12 | console.log(Object.prototype.toString.call(zao))
13 | console.timeEnd()
14 |
15 |
--------------------------------------------------------------------------------
/设计模式/设计模式.md:
--------------------------------------------------------------------------------
1 | # 设计模式
2 |
--------------------------------------------------------------------------------