From b70955eeab947aa8c3846dd229ed1576dbbe4a1e Mon Sep 17 00:00:00 2001 From: xugaoyi <894072666@qq.com> Date: Fri, 17 Apr 2020 16:34:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=B9=E9=87=8F=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=92=8C=E4=BF=AE=E6=94=B9front=20matter=E5=B7=A5?= =?UTF-8?q?=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.MD | 2 + docs/07.时间轴/01.时间轴.md | 1 - docs/《ES6 教程》笔记/01.ECMAScript 6 简介.md | 2 + docs/《ES6 教程》笔记/02.let 和 const 命令.md | 2 + docs/《ES6 教程》笔记/03.变量的解构赋值.md | 2 + docs/《ES6 教程》笔记/04.字符串的扩展.md | 2 + docs/《ES6 教程》笔记/05.字符串的新增方法.md | 2 + docs/《ES6 教程》笔记/06.正则的扩展.md | 2 + docs/《ES6 教程》笔记/07.数值的扩展.md | 2 + docs/《ES6 教程》笔记/08.函数的扩展.md | 2 + docs/《ES6 教程》笔记/09.数组的扩展.md | 2 + docs/《ES6 教程》笔记/10.对象的扩展.md | 2 + docs/《ES6 教程》笔记/11.对象的新增方法.md | 2 + docs/《ES6 教程》笔记/12.Symbol.md | 2 + .../13.Set 和 Map 数据结构.md | 2 + docs/《ES6 教程》笔记/14.Proxy.md | 2 + docs/《ES6 教程》笔记/15.Reflect.md | 2 + docs/《ES6 教程》笔记/16.Promise 对象.md | 2 + .../17.Iterator 和 for-of 循环.md | 2 + .../18.Generator 函数的语法.md | 2 + .../19.Generator 函数的异步应用.md | 2 + docs/《ES6 教程》笔记/20.async 函数.md | 2 + docs/《ES6 教程》笔记/21.Class 的基本语法.md | 2 + docs/《ES6 教程》笔记/22.Class 的继承.md | 2 + docs/《ES6 教程》笔记/23.Module 的语法.md | 2 + docs/《ES6 教程》笔记/24.Module 的加载实现.md | 2 + docs/《ES6 教程》笔记/25.编程风格.md | 2 + .../26.读懂 ECMAScript 规格.md | 2 + docs/《ES6 教程》笔记/27.异步遍历器.md | 2 + docs/《ES6 教程》笔记/28.ArrayBuffer.md | 2 + docs/《ES6 教程》笔记/29.最新提案.md | 2 + docs/《ES6 教程》笔记/30.装饰器.md | 2 + docs/《ES6 教程》笔记/31.函数式编程.md | 2 + docs/《ES6 教程》笔记/32.Mixin.md | 2 + docs/《ES6 教程》笔记/33.SIMD.md | 2 + docs/《ES6 教程》笔记/34.参考链接.md | 2 + .../01.初识 TypeScript/01.简介.md | 2 + .../01.初识 TypeScript/02.安装 TypeScript.md | 2 + .../03.编写第一个 TypeScript 程序.md | 2 + .../02.TypeScript 常用语法/01.基础类型.md | 2 + .../02.TypeScript 常用语法/02.变量声明.md | 2 + .../02.TypeScript 常用语法/03.接口.md | 2 + .../02.TypeScript 常用语法/04.类.md | 2 + .../02.TypeScript 常用语法/05.函数.md | 2 + .../02.TypeScript 常用语法/06.泛型.md | 2 + .../02.TypeScript 常用语法/07.类型推断.md | 2 + .../02.TypeScript 常用语法/08.高级类型.md | 2 + .../03.ts-axios 项目初始化/01.需求分析.md | 2 + .../03.ts-axios 项目初始化/02.初始化项目.md | 2 + .../03.ts-axios 项目初始化/03.编写基础请求代码.md | 2 + .../01.处理请求 url 参数.md | 2 + .../02.处理请求 body 数据.md | 2 + .../04.ts-axios 基础功能实现/03.处理请求 header.md | 2 + .../04.ts-axios 基础功能实现/04.获取响应数据.md | 2 + .../04.ts-axios 基础功能实现/05.处理响应 header.md | 2 + .../04.ts-axios 基础功能实现/06.处理响应 data.md | 2 + .../05.ts-axios 异常情况处理/01.错误处理.md | 2 + .../05.ts-axios 异常情况处理/02.错误信息增强.md | 2 + .../06.ts-axios 接口扩展/01.扩展接口.md | 2 + .../06.ts-axios 接口扩展/02.axios 函数重载.md | 2 + .../06.ts-axios 接口扩展/03.响应数据支持泛型.md | 2 + .../07.ts-axios 拦截器实现/01.拦截器设计与实现.md | 2 + .../01.合并配置的设计与实现.md | 2 + .../08.ts-axios 配置化实现/02.请求和响应配置化.md | 2 + .../03.扩展 create 静态接口.md | 2 + .../01.取消功能的设计与实现.md | 2 + .../10.ts-axios 更多功能实现/01.withCredentials.md | 2 + .../10.ts-axios 更多功能实现/02.XSRF 防御.md | 2 + .../03.上传和下载的进度监控.md | 2 + .../10.ts-axios 更多功能实现/04.HTTP 授权.md | 2 + .../10.ts-axios 更多功能实现/05.自定义合法状态码.md | 2 + .../10.ts-axios 更多功能实现/06.自定义参数序列化.md | 2 + .../10.ts-axios 更多功能实现/07.baseURL.md | 2 + .../10.ts-axios 更多功能实现/08.静态方法扩展.md | 2 + .../11.ts-axios 单元测试/01.前言.md | 2 + .../11.ts-axios 单元测试/02.Jest 安装和配置.md | 2 + .../11.ts-axios 单元测试/03.辅助模块单元测试.md | 2 + .../11.ts-axios 单元测试/04.请求模块单元测试.md | 2 + .../11.ts-axios 单元测试/05.headers 模块单元测试.md | 2 + .../06.Axios 实例模块单元测试.md | 2 + .../11.ts-axios 单元测试/07.拦截器模块单元测试.md | 2 + .../08.mergeConfig 模块单元测试.md | 2 + .../11.ts-axios 单元测试/09.请求取消模块单元测试.md | 2 + .../11.ts-axios 单元测试/10.剩余模块单元测试.md | 2 + .../01.ts-axios 编译与发布.md | 2 + .../12.ts-axios 部署与发布/02.引用 ts-axios 库.md | 2 + package.json | 1 + theme-vdoing/components/Home.vue | 547 +++++++++--------- theme-vdoing/components/Home改变中.vue | 485 ---------------- theme-vdoing/components/Home未改版.vue | 468 +++++++++++++++ theme-vdoing/components/Timeline.vue | 3 - utils/config.yaml | 14 - utils/config.yml | 12 + utils/editFrontmatter.js | 150 ++--- utils/frontmatter.js | 29 +- utils/modules/fn.js | 21 + 96 files changed, 1002 insertions(+), 899 deletions(-) delete mode 100644 theme-vdoing/components/Home改变中.vue create mode 100644 theme-vdoing/components/Home未改版.vue delete mode 100644 utils/config.yaml create mode 100644 utils/config.yml create mode 100644 utils/modules/fn.js diff --git a/README.MD b/README.MD index 9a7f2fa..99634d4 100644 --- a/README.MD +++ b/README.MD @@ -77,6 +77,8 @@ [palette.styl主题调色板使用说明](https://github.com/xugaoyi/vuepress-theme-vdoing/issues/345) +8. 专为主题定制的辅助工具: [批量修改front matter工具](https://github.com/xugaoyi/vuepress-theme-vdoing/issues/351) + ## Start ```bash diff --git a/docs/07.时间轴/01.时间轴.md b/docs/07.时间轴/01.时间轴.md index 41d3a67..872685d 100644 --- a/docs/07.时间轴/01.时间轴.md +++ b/docs/07.时间轴/01.时间轴.md @@ -2,7 +2,6 @@ pageComponent: name: Timeline # 组件名:Timeline => 时间轴组件 # data: - # tagBgColor: ['#11a8cd', '#F8B26A', '#67CC86', '#E15B64', '#F47E60', '#849B87'] # 注意,这里定义数组建议使用中括号的形式,避免把#井号解析为注释 # slogan: '只争朝夕,不负韶华!( •̀ ω •́ )✧' title: 时间轴 diff --git a/docs/《ES6 教程》笔记/01.ECMAScript 6 简介.md b/docs/《ES6 教程》笔记/01.ECMAScript 6 简介.md index 3dcba6b..28a64d1 100644 --- a/docs/《ES6 教程》笔记/01.ECMAScript 6 简介.md +++ b/docs/《ES6 教程》笔记/01.ECMAScript 6 简介.md @@ -2,6 +2,8 @@ title: ECMAScript 6 简介 date: 2020-01-12 15:45:35 permalink: /pages/f344d070a1031ef7 +author: + name: 阮一峰 --- > 说明:本章内容为博主在原教程基础上添加自己的学习笔记,来源,教程版权归原作者所有。 diff --git a/docs/《ES6 教程》笔记/02.let 和 const 命令.md b/docs/《ES6 教程》笔记/02.let 和 const 命令.md index 4b9a012..95f4366 100644 --- a/docs/《ES6 教程》笔记/02.let 和 const 命令.md +++ b/docs/《ES6 教程》笔记/02.let 和 const 命令.md @@ -2,6 +2,8 @@ title: let 和 const 命令 date: 2020-02-09 16:00:29 permalink: /pages/c1edd70a6b7c7872 +author: + name: 阮一峰 --- # let 和 const 命令 diff --git a/docs/《ES6 教程》笔记/03.变量的解构赋值.md b/docs/《ES6 教程》笔记/03.变量的解构赋值.md index 012785d..b79a763 100644 --- a/docs/《ES6 教程》笔记/03.变量的解构赋值.md +++ b/docs/《ES6 教程》笔记/03.变量的解构赋值.md @@ -2,6 +2,8 @@ title: 变量的解构赋值 date: 2020-02-09 16:00:29 permalink: /pages/b1ab10a62f7564da +author: + name: 阮一峰 --- # 变量的解构赋值 diff --git a/docs/《ES6 教程》笔记/04.字符串的扩展.md b/docs/《ES6 教程》笔记/04.字符串的扩展.md index 634224a..f6c0e60 100644 --- a/docs/《ES6 教程》笔记/04.字符串的扩展.md +++ b/docs/《ES6 教程》笔记/04.字符串的扩展.md @@ -2,6 +2,8 @@ title: 字符串的扩展 date: 2020-02-09 16:00:29 permalink: /pages/ca89eca8adeba5f4 +author: + name: 阮一峰 --- # 字符串的扩展 diff --git a/docs/《ES6 教程》笔记/05.字符串的新增方法.md b/docs/《ES6 教程》笔记/05.字符串的新增方法.md index 990fb99..2b0aa78 100644 --- a/docs/《ES6 教程》笔记/05.字符串的新增方法.md +++ b/docs/《ES6 教程》笔记/05.字符串的新增方法.md @@ -2,6 +2,8 @@ title: 字符串的新增方法 date: 2020-02-09 16:00:29 permalink: /pages/a650b4a0ebfc9350 +author: + name: 阮一峰 --- # 字符串的新增方法 diff --git a/docs/《ES6 教程》笔记/06.正则的扩展.md b/docs/《ES6 教程》笔记/06.正则的扩展.md index 0663adf..c580303 100644 --- a/docs/《ES6 教程》笔记/06.正则的扩展.md +++ b/docs/《ES6 教程》笔记/06.正则的扩展.md @@ -2,6 +2,8 @@ title: 正则的扩展 date: 2020-02-09 16:00:29 permalink: /pages/0473261a6ab0ee8c +author: + name: 阮一峰 --- # 正则的扩展 diff --git a/docs/《ES6 教程》笔记/07.数值的扩展.md b/docs/《ES6 教程》笔记/07.数值的扩展.md index 501bfaa..2a37ee5 100644 --- a/docs/《ES6 教程》笔记/07.数值的扩展.md +++ b/docs/《ES6 教程》笔记/07.数值的扩展.md @@ -2,6 +2,8 @@ title: 数值的扩展 date: 2020-02-09 16:00:29 permalink: /pages/5dfea9a0f2d1a392 +author: + name: 阮一峰 --- # 数值的扩展 diff --git a/docs/《ES6 教程》笔记/08.函数的扩展.md b/docs/《ES6 教程》笔记/08.函数的扩展.md index 2f59a96..f4de6e2 100644 --- a/docs/《ES6 教程》笔记/08.函数的扩展.md +++ b/docs/《ES6 教程》笔记/08.函数的扩展.md @@ -2,6 +2,8 @@ title: 函数的扩展 date: 2020-02-09 16:00:29 permalink: /pages/8ed309d668b20264 +author: + name: 阮一峰 --- # 函数的扩展 diff --git a/docs/《ES6 教程》笔记/09.数组的扩展.md b/docs/《ES6 教程》笔记/09.数组的扩展.md index ee106fc..8b17917 100644 --- a/docs/《ES6 教程》笔记/09.数组的扩展.md +++ b/docs/《ES6 教程》笔记/09.数组的扩展.md @@ -2,6 +2,8 @@ title: 数组的扩展 date: 2020-02-09 16:00:29 permalink: /pages/e34009d60d8bc4b2 +author: + name: 阮一峰 --- # 数组的扩展 diff --git a/docs/《ES6 教程》笔记/10.对象的扩展.md b/docs/《ES6 教程》笔记/10.对象的扩展.md index db9c821..dc0c4d7 100644 --- a/docs/《ES6 教程》笔记/10.对象的扩展.md +++ b/docs/《ES6 教程》笔记/10.对象的扩展.md @@ -2,6 +2,8 @@ title: 对象的扩展 date: 2020-02-09 16:00:29 permalink: /pages/b5e3e0a0ff6e9c25 +author: + name: 阮一峰 --- # 对象的扩展 diff --git a/docs/《ES6 教程》笔记/11.对象的新增方法.md b/docs/《ES6 教程》笔记/11.对象的新增方法.md index 4538c8d..6412a02 100644 --- a/docs/《ES6 教程》笔记/11.对象的新增方法.md +++ b/docs/《ES6 教程》笔记/11.对象的新增方法.md @@ -2,6 +2,8 @@ title: 对象的新增方法 date: 2020-02-09 16:00:29 permalink: /pages/e85e68947502cf90 +author: + name: 阮一峰 --- # 对象的新增方法 diff --git a/docs/《ES6 教程》笔记/12.Symbol.md b/docs/《ES6 教程》笔记/12.Symbol.md index 1f9238a..f7645fb 100644 --- a/docs/《ES6 教程》笔记/12.Symbol.md +++ b/docs/《ES6 教程》笔记/12.Symbol.md @@ -2,6 +2,8 @@ title: Symbol date: 2020-02-09 16:00:29 permalink: /pages/02c86eb2792f3262 +author: + name: 阮一峰 --- # Symbol diff --git a/docs/《ES6 教程》笔记/13.Set 和 Map 数据结构.md b/docs/《ES6 教程》笔记/13.Set 和 Map 数据结构.md index 1f9d227..6a525d5 100644 --- a/docs/《ES6 教程》笔记/13.Set 和 Map 数据结构.md +++ b/docs/《ES6 教程》笔记/13.Set 和 Map 数据结构.md @@ -2,6 +2,8 @@ title: Set 和 Map 数据结构 date: 2020-02-09 16:00:29 permalink: /pages/0c21dae358fca16b +author: + name: 阮一峰 --- # Set 和 Map 数据结构 diff --git a/docs/《ES6 教程》笔记/14.Proxy.md b/docs/《ES6 教程》笔记/14.Proxy.md index 152b72e..bc69898 100644 --- a/docs/《ES6 教程》笔记/14.Proxy.md +++ b/docs/《ES6 教程》笔记/14.Proxy.md @@ -2,6 +2,8 @@ title: Proxy date: 2020-02-09 16:00:29 permalink: /pages/f56ec2ab97d60483 +author: + name: 阮一峰 --- # Proxy diff --git a/docs/《ES6 教程》笔记/15.Reflect.md b/docs/《ES6 教程》笔记/15.Reflect.md index 6aa744e..cf575e6 100644 --- a/docs/《ES6 教程》笔记/15.Reflect.md +++ b/docs/《ES6 教程》笔记/15.Reflect.md @@ -2,6 +2,8 @@ title: Reflect date: 2020-02-09 16:00:29 permalink: /pages/74de3e45e4491e95 +author: + name: 阮一峰 --- # Reflect diff --git a/docs/《ES6 教程》笔记/16.Promise 对象.md b/docs/《ES6 教程》笔记/16.Promise 对象.md index b6aa039..6ccaa58 100644 --- a/docs/《ES6 教程》笔记/16.Promise 对象.md +++ b/docs/《ES6 教程》笔记/16.Promise 对象.md @@ -2,6 +2,8 @@ title: Promise 对象 date: 2020-02-09 16:00:29 permalink: /pages/2810ae8985e9bd52 +author: + name: 阮一峰 --- # Promise 对象 diff --git a/docs/《ES6 教程》笔记/17.Iterator 和 for-of 循环.md b/docs/《ES6 教程》笔记/17.Iterator 和 for-of 循环.md index c8cac18..019e631 100644 --- a/docs/《ES6 教程》笔记/17.Iterator 和 for-of 循环.md +++ b/docs/《ES6 教程》笔记/17.Iterator 和 for-of 循环.md @@ -2,6 +2,8 @@ title: Iterator 和 for-of 循环 date: 2020-02-09 16:00:29 permalink: /pages/48df907ad3570f3d +author: + name: 阮一峰 --- # Iterator 和 for...of 循环 diff --git a/docs/《ES6 教程》笔记/18.Generator 函数的语法.md b/docs/《ES6 教程》笔记/18.Generator 函数的语法.md index b2484ac..54e1726 100644 --- a/docs/《ES6 教程》笔记/18.Generator 函数的语法.md +++ b/docs/《ES6 教程》笔记/18.Generator 函数的语法.md @@ -2,6 +2,8 @@ title: Generator 函数的语法 date: 2020-02-09 16:00:29 permalink: /pages/718b48ed9ce0adce +author: + name: 阮一峰 --- # Generator 函数的语法 diff --git a/docs/《ES6 教程》笔记/19.Generator 函数的异步应用.md b/docs/《ES6 教程》笔记/19.Generator 函数的异步应用.md index 037562a..cd669ce 100644 --- a/docs/《ES6 教程》笔记/19.Generator 函数的异步应用.md +++ b/docs/《ES6 教程》笔记/19.Generator 函数的异步应用.md @@ -2,6 +2,8 @@ title: Generator 函数的异步应用 date: 2020-02-09 16:00:29 permalink: /pages/75af7031eb66847b +author: + name: 阮一峰 --- # Generator 函数的异步应用 diff --git a/docs/《ES6 教程》笔记/20.async 函数.md b/docs/《ES6 教程》笔记/20.async 函数.md index 7df22f5..03aea5c 100644 --- a/docs/《ES6 教程》笔记/20.async 函数.md +++ b/docs/《ES6 教程》笔记/20.async 函数.md @@ -2,6 +2,8 @@ title: async 函数 date: 2020-02-09 16:00:29 permalink: /pages/3777253e65bac487 +author: + name: 阮一峰 --- # async 函数 diff --git a/docs/《ES6 教程》笔记/21.Class 的基本语法.md b/docs/《ES6 教程》笔记/21.Class 的基本语法.md index 23aa372..9c36c94 100644 --- a/docs/《ES6 教程》笔记/21.Class 的基本语法.md +++ b/docs/《ES6 教程》笔记/21.Class 的基本语法.md @@ -2,6 +2,8 @@ title: Class 的基本语法 date: 2020-02-09 16:00:29 permalink: /pages/e831e1593c82bbe0 +author: + name: 阮一峰 --- # Class 的基本语法 diff --git a/docs/《ES6 教程》笔记/22.Class 的继承.md b/docs/《ES6 教程》笔记/22.Class 的继承.md index bb4deb8..f7cfc90 100644 --- a/docs/《ES6 教程》笔记/22.Class 的继承.md +++ b/docs/《ES6 教程》笔记/22.Class 的继承.md @@ -2,6 +2,8 @@ title: Class 的继承 date: 2020-02-09 16:00:29 permalink: /pages/83f8c3a0cd87dd83 +author: + name: 阮一峰 --- # Class 的继承 diff --git a/docs/《ES6 教程》笔记/23.Module 的语法.md b/docs/《ES6 教程》笔记/23.Module 的语法.md index aca7038..c3a6422 100644 --- a/docs/《ES6 教程》笔记/23.Module 的语法.md +++ b/docs/《ES6 教程》笔记/23.Module 的语法.md @@ -2,6 +2,8 @@ title: Module 的语法 date: 2020-02-09 16:00:29 permalink: /pages/efe2fb04eb8ac5fb +author: + name: 阮一峰 --- # Module 的语法 diff --git a/docs/《ES6 教程》笔记/24.Module 的加载实现.md b/docs/《ES6 教程》笔记/24.Module 的加载实现.md index 60de87d..ef12249 100644 --- a/docs/《ES6 教程》笔记/24.Module 的加载实现.md +++ b/docs/《ES6 教程》笔记/24.Module 的加载实现.md @@ -2,6 +2,8 @@ title: Module 的加载实现 date: 2020-02-09 16:00:29 permalink: /pages/a79ca2e64ceae213 +author: + name: 阮一峰 --- # Module 的加载实现 diff --git a/docs/《ES6 教程》笔记/25.编程风格.md b/docs/《ES6 教程》笔记/25.编程风格.md index 0e477b5..4fb26f4 100644 --- a/docs/《ES6 教程》笔记/25.编程风格.md +++ b/docs/《ES6 教程》笔记/25.编程风格.md @@ -2,6 +2,8 @@ title: 编程风格 date: 2020-02-09 16:00:29 permalink: /pages/984bf549204bb266 +author: + name: 阮一峰 --- # 编程风格 diff --git a/docs/《ES6 教程》笔记/26.读懂 ECMAScript 规格.md b/docs/《ES6 教程》笔记/26.读懂 ECMAScript 规格.md index 10c3c87..20b4cbf 100644 --- a/docs/《ES6 教程》笔记/26.读懂 ECMAScript 规格.md +++ b/docs/《ES6 教程》笔记/26.读懂 ECMAScript 规格.md @@ -2,6 +2,8 @@ title: 读懂 ECMAScript 规格 date: 2020-02-09 16:00:29 permalink: /pages/32c35f7651d6e58e +author: + name: 阮一峰 --- # 读懂 ECMAScript 规格 diff --git a/docs/《ES6 教程》笔记/27.异步遍历器.md b/docs/《ES6 教程》笔记/27.异步遍历器.md index 3df0c4a..5b4d0eb 100644 --- a/docs/《ES6 教程》笔记/27.异步遍历器.md +++ b/docs/《ES6 教程》笔记/27.异步遍历器.md @@ -2,6 +2,8 @@ title: 异步遍历器 date: 2020-02-09 16:00:29 permalink: /pages/16121351be68691b +author: + name: 阮一峰 --- # 异步遍历器 diff --git a/docs/《ES6 教程》笔记/28.ArrayBuffer.md b/docs/《ES6 教程》笔记/28.ArrayBuffer.md index c2c0106..adf93b8 100644 --- a/docs/《ES6 教程》笔记/28.ArrayBuffer.md +++ b/docs/《ES6 教程》笔记/28.ArrayBuffer.md @@ -2,6 +2,8 @@ title: ArrayBuffer date: 2020-02-09 16:00:29 permalink: /pages/a2ba314746bfdbdd +author: + name: 阮一峰 --- # ArrayBuffer diff --git a/docs/《ES6 教程》笔记/29.最新提案.md b/docs/《ES6 教程》笔记/29.最新提案.md index 33b5001..ad09ae8 100644 --- a/docs/《ES6 教程》笔记/29.最新提案.md +++ b/docs/《ES6 教程》笔记/29.最新提案.md @@ -2,6 +2,8 @@ title: 最新提案 date: 2020-02-09 16:00:30 permalink: /pages/7188882b8d65af1b +author: + name: 阮一峰 --- # 最新提案 diff --git a/docs/《ES6 教程》笔记/30.装饰器.md b/docs/《ES6 教程》笔记/30.装饰器.md index 9c780f5..9362f8f 100644 --- a/docs/《ES6 教程》笔记/30.装饰器.md +++ b/docs/《ES6 教程》笔记/30.装饰器.md @@ -2,6 +2,8 @@ title: 装饰器 date: 2020-02-09 16:00:30 permalink: /pages/e97bc1e5626b082c +author: + name: 阮一峰 --- # 装饰器 diff --git a/docs/《ES6 教程》笔记/31.函数式编程.md b/docs/《ES6 教程》笔记/31.函数式编程.md index cc1f8a4..911dea0 100644 --- a/docs/《ES6 教程》笔记/31.函数式编程.md +++ b/docs/《ES6 教程》笔记/31.函数式编程.md @@ -2,6 +2,8 @@ title: 函数式编程 date: 2020-02-09 16:00:30 permalink: /pages/1cf50330655efc69 +author: + name: 阮一峰 --- # 函数式编程 diff --git a/docs/《ES6 教程》笔记/32.Mixin.md b/docs/《ES6 教程》笔记/32.Mixin.md index 671540c..60568f8 100644 --- a/docs/《ES6 教程》笔记/32.Mixin.md +++ b/docs/《ES6 教程》笔记/32.Mixin.md @@ -2,6 +2,8 @@ title: Mixin date: 2020-02-09 16:00:30 permalink: /pages/6a8e2dc558da1b39 +author: + name: 阮一峰 --- # Mixin diff --git a/docs/《ES6 教程》笔记/33.SIMD.md b/docs/《ES6 教程》笔记/33.SIMD.md index ca18a10..949e73e 100644 --- a/docs/《ES6 教程》笔记/33.SIMD.md +++ b/docs/《ES6 教程》笔记/33.SIMD.md @@ -2,6 +2,8 @@ title: SIMD date: 2020-02-09 16:00:30 permalink: /pages/8e8f80f69b775a56 +author: + name: 阮一峰 --- # SIMD diff --git a/docs/《ES6 教程》笔记/34.参考链接.md b/docs/《ES6 教程》笔记/34.参考链接.md index 605d200..dd7d045 100644 --- a/docs/《ES6 教程》笔记/34.参考链接.md +++ b/docs/《ES6 教程》笔记/34.参考链接.md @@ -2,6 +2,8 @@ title: 参考链接 date: 2020-02-09 16:00:30 permalink: /pages/ea6f3b870f6dab69 +author: + name: 阮一峰 --- # 参考链接 diff --git a/docs/《TypeScript 从零实现 axios》/01.初识 TypeScript/01.简介.md b/docs/《TypeScript 从零实现 axios》/01.初识 TypeScript/01.简介.md index 990d080..8424e75 100644 --- a/docs/《TypeScript 从零实现 axios》/01.初识 TypeScript/01.简介.md +++ b/docs/《TypeScript 从零实现 axios》/01.初识 TypeScript/01.简介.md @@ -2,6 +2,8 @@ title: 简介 date: 2020-01-05 10:15:07 permalink: /pages/e05dce83e5129785 +author: + name: HuangYi --- # 简介 diff --git a/docs/《TypeScript 从零实现 axios》/01.初识 TypeScript/02.安装 TypeScript.md b/docs/《TypeScript 从零实现 axios》/01.初识 TypeScript/02.安装 TypeScript.md index e962a84..dd77624 100644 --- a/docs/《TypeScript 从零实现 axios》/01.初识 TypeScript/02.安装 TypeScript.md +++ b/docs/《TypeScript 从零实现 axios》/01.初识 TypeScript/02.安装 TypeScript.md @@ -2,6 +2,8 @@ title: 安装 TypeScript date: 2020-01-05 10:15:07 permalink: /pages/064e0f7b6b6142c8 +author: + name: HuangYi --- # 安装 TypeScript diff --git a/docs/《TypeScript 从零实现 axios》/01.初识 TypeScript/03.编写第一个 TypeScript 程序.md b/docs/《TypeScript 从零实现 axios》/01.初识 TypeScript/03.编写第一个 TypeScript 程序.md index b87c77e..88e20f5 100644 --- a/docs/《TypeScript 从零实现 axios》/01.初识 TypeScript/03.编写第一个 TypeScript 程序.md +++ b/docs/《TypeScript 从零实现 axios》/01.初识 TypeScript/03.编写第一个 TypeScript 程序.md @@ -2,6 +2,8 @@ title: 编写第一个 TypeScript 程序 date: 2020-01-05 10:15:07 permalink: /pages/c85249f40e7a3517 +author: + name: HuangYi --- # 编写第一个 TypeScript 程序 diff --git a/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/01.基础类型.md b/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/01.基础类型.md index d8fdccf..1789ac5 100644 --- a/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/01.基础类型.md +++ b/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/01.基础类型.md @@ -2,6 +2,8 @@ title: 基础类型 date: 2020-01-05 10:17:47 permalink: /pages/28672e2743bbc3a7 +author: + name: HuangYi --- # 基础类型 diff --git a/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/02.变量声明.md b/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/02.变量声明.md index 4e54c5c..8117798 100644 --- a/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/02.变量声明.md +++ b/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/02.变量声明.md @@ -2,6 +2,8 @@ title: 变量声明 date: 2020-01-05 10:17:47 permalink: /pages/54add7f5cf78088e +author: + name: HuangYi --- # 变量声明 diff --git a/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/03.接口.md b/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/03.接口.md index 281f985..24941f7 100644 --- a/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/03.接口.md +++ b/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/03.接口.md @@ -2,6 +2,8 @@ title: 接口 date: 2020-01-05 10:17:47 permalink: /pages/54ea89b497ec3bb3 +author: + name: HuangYi --- # 接口 diff --git a/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/04.类.md b/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/04.类.md index 3ee221b..f22a38a 100644 --- a/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/04.类.md +++ b/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/04.类.md @@ -2,6 +2,8 @@ title: 类 date: 2020-01-05 10:17:47 permalink: /pages/fad060bd9a8bfac6 +author: + name: HuangYi --- # 类 diff --git a/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/05.函数.md b/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/05.函数.md index 256592a..e9dc7b0 100644 --- a/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/05.函数.md +++ b/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/05.函数.md @@ -2,6 +2,8 @@ title: 函数 date: 2020-01-05 10:17:47 permalink: /pages/870a51ba2a9edfad +author: + name: HuangYi --- # 函数 diff --git a/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/06.泛型.md b/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/06.泛型.md index 2a54bbd..a4d2080 100644 --- a/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/06.泛型.md +++ b/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/06.泛型.md @@ -2,6 +2,8 @@ title: 泛型 date: 2020-01-05 10:17:47 permalink: /pages/8045759ec4ad3c01 +author: + name: HuangYi --- # 泛型 diff --git a/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/07.类型推断.md b/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/07.类型推断.md index a4e56d3..882f973 100644 --- a/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/07.类型推断.md +++ b/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/07.类型推断.md @@ -2,6 +2,8 @@ title: 类型推断 date: 2020-01-05 10:17:47 permalink: /pages/7279420c899c505d +author: + name: HuangYi --- # 类型推断 diff --git a/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/08.高级类型.md b/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/08.高级类型.md index 75e5560..89298e6 100644 --- a/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/08.高级类型.md +++ b/docs/《TypeScript 从零实现 axios》/02.TypeScript 常用语法/08.高级类型.md @@ -2,6 +2,8 @@ title: 高级类型 date: 2020-01-05 10:17:47 permalink: /pages/3fb6c2f52ab398e3 +author: + name: HuangYi --- # 高级类型 diff --git a/docs/《TypeScript 从零实现 axios》/03.ts-axios 项目初始化/01.需求分析.md b/docs/《TypeScript 从零实现 axios》/03.ts-axios 项目初始化/01.需求分析.md index df18a0f..b34c1c9 100644 --- a/docs/《TypeScript 从零实现 axios》/03.ts-axios 项目初始化/01.需求分析.md +++ b/docs/《TypeScript 从零实现 axios》/03.ts-axios 项目初始化/01.需求分析.md @@ -2,6 +2,8 @@ title: 需求分析 date: 2020-01-05 10:56:02 permalink: /pages/195af93fcc871b8b +author: + name: HuangYi --- # 需求分析 diff --git a/docs/《TypeScript 从零实现 axios》/03.ts-axios 项目初始化/02.初始化项目.md b/docs/《TypeScript 从零实现 axios》/03.ts-axios 项目初始化/02.初始化项目.md index 240357f..11f2ae6 100644 --- a/docs/《TypeScript 从零实现 axios》/03.ts-axios 项目初始化/02.初始化项目.md +++ b/docs/《TypeScript 从零实现 axios》/03.ts-axios 项目初始化/02.初始化项目.md @@ -2,6 +2,8 @@ title: 初始化项目 date: 2020-01-05 10:56:02 permalink: /pages/6e11ac76475a2b3e +author: + name: HuangYi --- # 初始化项目 diff --git a/docs/《TypeScript 从零实现 axios》/03.ts-axios 项目初始化/03.编写基础请求代码.md b/docs/《TypeScript 从零实现 axios》/03.ts-axios 项目初始化/03.编写基础请求代码.md index 9651bf3..b30e849 100644 --- a/docs/《TypeScript 从零实现 axios》/03.ts-axios 项目初始化/03.编写基础请求代码.md +++ b/docs/《TypeScript 从零实现 axios》/03.ts-axios 项目初始化/03.编写基础请求代码.md @@ -2,6 +2,8 @@ title: 编写基础请求代码 date: 2020-01-05 10:56:02 permalink: /pages/acfe1e0b401fa984 +author: + name: HuangYi --- # 编写基础请求代码 diff --git a/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/01.处理请求 url 参数.md b/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/01.处理请求 url 参数.md index 43c5e3c..7de8a10 100644 --- a/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/01.处理请求 url 参数.md +++ b/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/01.处理请求 url 参数.md @@ -2,6 +2,8 @@ title: 处理请求 url 参数 date: 2020-01-05 10:56:02 permalink: /pages/1313dae575f6dddf +author: + name: HuangYi --- # 处理请求 url 参数 diff --git a/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/02.处理请求 body 数据.md b/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/02.处理请求 body 数据.md index 9213043..4d40502 100644 --- a/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/02.处理请求 body 数据.md +++ b/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/02.处理请求 body 数据.md @@ -2,6 +2,8 @@ title: 处理请求 body 数据 date: 2020-01-05 10:56:02 permalink: /pages/887cd0918e2543d8 +author: + name: HuangYi --- # 处理请求 body 数据 diff --git a/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/03.处理请求 header.md b/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/03.处理请求 header.md index e2d21f9..786689c 100644 --- a/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/03.处理请求 header.md +++ b/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/03.处理请求 header.md @@ -2,6 +2,8 @@ title: 处理请求 header date: 2020-01-05 10:56:02 permalink: /pages/35c0ec1bb0b0faaf +author: + name: HuangYi --- # 处理请求 header diff --git a/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/04.获取响应数据.md b/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/04.获取响应数据.md index b88fe92..d29fcda 100644 --- a/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/04.获取响应数据.md +++ b/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/04.获取响应数据.md @@ -2,6 +2,8 @@ title: 获取响应数据 date: 2020-01-05 10:56:02 permalink: /pages/a57debe141e1e4f4 +author: + name: HuangYi --- # 获取响应数据 diff --git a/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/05.处理响应 header.md b/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/05.处理响应 header.md index e6c07b8..ffb2c43 100644 --- a/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/05.处理响应 header.md +++ b/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/05.处理响应 header.md @@ -2,6 +2,8 @@ title: 处理响应 header date: 2020-01-05 10:56:02 permalink: /pages/927161662ca32c24 +author: + name: HuangYi --- # 处理响应 header diff --git a/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/06.处理响应 data.md b/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/06.处理响应 data.md index dce58b6..e902f06 100644 --- a/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/06.处理响应 data.md +++ b/docs/《TypeScript 从零实现 axios》/04.ts-axios 基础功能实现/06.处理响应 data.md @@ -2,6 +2,8 @@ title: 处理响应 data date: 2020-01-05 10:56:02 permalink: /pages/922cb4268499dc3f +author: + name: HuangYi --- # 处理响应 data diff --git a/docs/《TypeScript 从零实现 axios》/05.ts-axios 异常情况处理/01.错误处理.md b/docs/《TypeScript 从零实现 axios》/05.ts-axios 异常情况处理/01.错误处理.md index b24631b..1ec2b52 100644 --- a/docs/《TypeScript 从零实现 axios》/05.ts-axios 异常情况处理/01.错误处理.md +++ b/docs/《TypeScript 从零实现 axios》/05.ts-axios 异常情况处理/01.错误处理.md @@ -2,6 +2,8 @@ title: 错误处理 date: 2020-01-05 10:56:02 permalink: /pages/6a8bef7b98dfdcf9 +author: + name: HuangYi --- # 错误处理 diff --git a/docs/《TypeScript 从零实现 axios》/05.ts-axios 异常情况处理/02.错误信息增强.md b/docs/《TypeScript 从零实现 axios》/05.ts-axios 异常情况处理/02.错误信息增强.md index 2c9536e..e72c940 100644 --- a/docs/《TypeScript 从零实现 axios》/05.ts-axios 异常情况处理/02.错误信息增强.md +++ b/docs/《TypeScript 从零实现 axios》/05.ts-axios 异常情况处理/02.错误信息增强.md @@ -2,6 +2,8 @@ title: 错误信息增强 date: 2020-01-05 10:56:02 permalink: /pages/22d581d8c2860b8a +author: + name: HuangYi --- # 错误信息增强 diff --git a/docs/《TypeScript 从零实现 axios》/06.ts-axios 接口扩展/01.扩展接口.md b/docs/《TypeScript 从零实现 axios》/06.ts-axios 接口扩展/01.扩展接口.md index 324f3c9..0b128e6 100644 --- a/docs/《TypeScript 从零实现 axios》/06.ts-axios 接口扩展/01.扩展接口.md +++ b/docs/《TypeScript 从零实现 axios》/06.ts-axios 接口扩展/01.扩展接口.md @@ -2,6 +2,8 @@ title: 扩展接口 date: 2020-01-05 10:56:02 permalink: /pages/034e320f4af88bd4 +author: + name: HuangYi --- # 扩展接口 diff --git a/docs/《TypeScript 从零实现 axios》/06.ts-axios 接口扩展/02.axios 函数重载.md b/docs/《TypeScript 从零实现 axios》/06.ts-axios 接口扩展/02.axios 函数重载.md index 6691e45..70ecb2b 100644 --- a/docs/《TypeScript 从零实现 axios》/06.ts-axios 接口扩展/02.axios 函数重载.md +++ b/docs/《TypeScript 从零实现 axios》/06.ts-axios 接口扩展/02.axios 函数重载.md @@ -2,6 +2,8 @@ title: axios 函数重载 date: 2020-01-05 10:56:02 permalink: /pages/8af227eae851ec97 +author: + name: HuangYi --- # axios 函数重载 diff --git a/docs/《TypeScript 从零实现 axios》/06.ts-axios 接口扩展/03.响应数据支持泛型.md b/docs/《TypeScript 从零实现 axios》/06.ts-axios 接口扩展/03.响应数据支持泛型.md index 478fdc5..b2d604a 100644 --- a/docs/《TypeScript 从零实现 axios》/06.ts-axios 接口扩展/03.响应数据支持泛型.md +++ b/docs/《TypeScript 从零实现 axios》/06.ts-axios 接口扩展/03.响应数据支持泛型.md @@ -2,6 +2,8 @@ title: 响应数据支持泛型 date: 2020-01-05 10:56:02 permalink: /pages/c4489d0bab02cc0c +author: + name: HuangYi --- # 响应数据支持泛型 diff --git a/docs/《TypeScript 从零实现 axios》/07.ts-axios 拦截器实现/01.拦截器设计与实现.md b/docs/《TypeScript 从零实现 axios》/07.ts-axios 拦截器实现/01.拦截器设计与实现.md index 236f46d..6e712e6 100644 --- a/docs/《TypeScript 从零实现 axios》/07.ts-axios 拦截器实现/01.拦截器设计与实现.md +++ b/docs/《TypeScript 从零实现 axios》/07.ts-axios 拦截器实现/01.拦截器设计与实现.md @@ -2,6 +2,8 @@ title: 拦截器设计与实现 date: 2020-01-05 10:56:02 permalink: /pages/70651900f022f586 +author: + name: HuangYi --- 拦截器设计与实现 diff --git a/docs/《TypeScript 从零实现 axios》/08.ts-axios 配置化实现/01.合并配置的设计与实现.md b/docs/《TypeScript 从零实现 axios》/08.ts-axios 配置化实现/01.合并配置的设计与实现.md index 5c390e9..392edc9 100644 --- a/docs/《TypeScript 从零实现 axios》/08.ts-axios 配置化实现/01.合并配置的设计与实现.md +++ b/docs/《TypeScript 从零实现 axios》/08.ts-axios 配置化实现/01.合并配置的设计与实现.md @@ -2,6 +2,8 @@ title: 合并配置的设计与实现 date: 2020-01-05 10:56:02 permalink: /pages/937e4de6b81edeca +author: + name: HuangYi --- # 合并配置的设计与实现 diff --git a/docs/《TypeScript 从零实现 axios》/08.ts-axios 配置化实现/02.请求和响应配置化.md b/docs/《TypeScript 从零实现 axios》/08.ts-axios 配置化实现/02.请求和响应配置化.md index 9fcb91d..eca1316 100644 --- a/docs/《TypeScript 从零实现 axios》/08.ts-axios 配置化实现/02.请求和响应配置化.md +++ b/docs/《TypeScript 从零实现 axios》/08.ts-axios 配置化实现/02.请求和响应配置化.md @@ -2,6 +2,8 @@ title: 请求和响应配置化 date: 2020-01-05 10:56:02 permalink: /pages/f5b627bfebba87fc +author: + name: HuangYi --- # 请求和响应配置化 diff --git a/docs/《TypeScript 从零实现 axios》/08.ts-axios 配置化实现/03.扩展 create 静态接口.md b/docs/《TypeScript 从零实现 axios》/08.ts-axios 配置化实现/03.扩展 create 静态接口.md index 9a71113..73659b7 100644 --- a/docs/《TypeScript 从零实现 axios》/08.ts-axios 配置化实现/03.扩展 create 静态接口.md +++ b/docs/《TypeScript 从零实现 axios》/08.ts-axios 配置化实现/03.扩展 create 静态接口.md @@ -2,6 +2,8 @@ title: 扩展 create 静态接口 date: 2020-01-05 10:56:02 permalink: /pages/7b49658c26f613bf +author: + name: HuangYi --- # 扩展 axios.create 静态接口 diff --git a/docs/《TypeScript 从零实现 axios》/09.ts-axios 取消功能实现/01.取消功能的设计与实现.md b/docs/《TypeScript 从零实现 axios》/09.ts-axios 取消功能实现/01.取消功能的设计与实现.md index 9c21d63..44ac707 100644 --- a/docs/《TypeScript 从零实现 axios》/09.ts-axios 取消功能实现/01.取消功能的设计与实现.md +++ b/docs/《TypeScript 从零实现 axios》/09.ts-axios 取消功能实现/01.取消功能的设计与实现.md @@ -2,6 +2,8 @@ title: 取消功能的设计与实现 date: 2020-01-05 10:56:02 permalink: /pages/fdc6da5372397430 +author: + name: HuangYi --- # 取消功能的设计与实现 diff --git a/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/01.withCredentials.md b/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/01.withCredentials.md index ea7de1e..a2b648a 100644 --- a/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/01.withCredentials.md +++ b/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/01.withCredentials.md @@ -2,6 +2,8 @@ title: withCredentials date: 2020-01-05 10:56:02 permalink: /pages/5dce43eba796a2ab +author: + name: HuangYi --- # withCredentials diff --git a/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/02.XSRF 防御.md b/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/02.XSRF 防御.md index 74a099f..e602cbd 100644 --- a/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/02.XSRF 防御.md +++ b/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/02.XSRF 防御.md @@ -2,6 +2,8 @@ title: XSRF 防御 date: 2020-01-05 10:56:02 permalink: /pages/390cb70e2b619449 +author: + name: HuangYi --- # XSRF 防御 diff --git a/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/03.上传和下载的进度监控.md b/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/03.上传和下载的进度监控.md index f420d0b..4b0a0a5 100644 --- a/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/03.上传和下载的进度监控.md +++ b/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/03.上传和下载的进度监控.md @@ -2,6 +2,8 @@ title: 上传和下载的进度监控 date: 2020-01-05 10:56:02 permalink: /pages/1376fd897809036e +author: + name: HuangYi --- # 上传和下载的进度监控 diff --git a/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/04.HTTP 授权.md b/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/04.HTTP 授权.md index 203bbd2..2808768 100644 --- a/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/04.HTTP 授权.md +++ b/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/04.HTTP 授权.md @@ -2,6 +2,8 @@ title: HTTP 授权 date: 2020-01-05 10:56:02 permalink: /pages/89cd6496c23159ae +author: + name: HuangYi --- # HTTP 授权 diff --git a/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/05.自定义合法状态码.md b/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/05.自定义合法状态码.md index 60612b2..a8b8150 100644 --- a/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/05.自定义合法状态码.md +++ b/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/05.自定义合法状态码.md @@ -2,6 +2,8 @@ title: 自定义合法状态码 date: 2020-01-05 10:56:02 permalink: /pages/40b41ce8e8159567 +author: + name: HuangYi --- # 自定义合法状态码 diff --git a/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/06.自定义参数序列化.md b/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/06.自定义参数序列化.md index c71aa92..054c2af 100644 --- a/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/06.自定义参数序列化.md +++ b/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/06.自定义参数序列化.md @@ -2,6 +2,8 @@ title: 自定义参数序列化 date: 2020-01-05 10:56:02 permalink: /pages/7753b8141663e54a +author: + name: HuangYi --- # 自定义参数序列化 diff --git a/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/07.baseURL.md b/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/07.baseURL.md index 0360bce..b200d36 100644 --- a/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/07.baseURL.md +++ b/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/07.baseURL.md @@ -2,6 +2,8 @@ title: baseURL date: 2020-01-05 10:56:02 permalink: /pages/0b9f2ee2b4dbb728 +author: + name: HuangYi --- # baseURL diff --git a/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/08.静态方法扩展.md b/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/08.静态方法扩展.md index bbe8a3f..c1b40f4 100644 --- a/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/08.静态方法扩展.md +++ b/docs/《TypeScript 从零实现 axios》/10.ts-axios 更多功能实现/08.静态方法扩展.md @@ -2,6 +2,8 @@ title: 静态方法扩展 date: 2020-01-05 10:56:02 permalink: /pages/c26b053540a7dafa +author: + name: HuangYi --- # 静态方法扩展 diff --git a/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/01.前言.md b/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/01.前言.md index 21d3edf..a7830ce 100644 --- a/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/01.前言.md +++ b/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/01.前言.md @@ -2,6 +2,8 @@ title: 前言 date: 2020-01-05 10:56:02 permalink: /pages/df36888424843793 +author: + name: HuangYi --- # 前言 diff --git a/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/02.Jest 安装和配置.md b/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/02.Jest 安装和配置.md index bf54d3b..974af28 100644 --- a/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/02.Jest 安装和配置.md +++ b/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/02.Jest 安装和配置.md @@ -2,6 +2,8 @@ title: Jest 安装和配置 date: 2020-01-05 10:56:02 permalink: /pages/bf5c625a35757b37 +author: + name: HuangYi --- # Jest 安装和配置 diff --git a/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/03.辅助模块单元测试.md b/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/03.辅助模块单元测试.md index 605233a..b0985bc 100644 --- a/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/03.辅助模块单元测试.md +++ b/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/03.辅助模块单元测试.md @@ -2,6 +2,8 @@ title: 辅助模块单元测试 date: 2020-01-05 10:56:02 permalink: /pages/13f147a9b355c4c1 +author: + name: HuangYi --- # 辅助模块单元测试 diff --git a/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/04.请求模块单元测试.md b/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/04.请求模块单元测试.md index f1c2431..af0197f 100644 --- a/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/04.请求模块单元测试.md +++ b/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/04.请求模块单元测试.md @@ -2,6 +2,8 @@ title: 请求模块单元测试 date: 2020-01-05 10:56:02 permalink: /pages/e1d15dec8634e6b5 +author: + name: HuangYi --- # 请求模块单元测试 diff --git a/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/05.headers 模块单元测试.md b/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/05.headers 模块单元测试.md index 7b32944..1047b24 100644 --- a/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/05.headers 模块单元测试.md +++ b/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/05.headers 模块单元测试.md @@ -2,6 +2,8 @@ title: headers 模块单元测试 date: 2020-01-05 10:56:02 permalink: /pages/ddd86ec39b5dfe33 +author: + name: HuangYi --- # headers 模块单元测试 diff --git a/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/06.Axios 实例模块单元测试.md b/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/06.Axios 实例模块单元测试.md index d6615d1..78770f0 100644 --- a/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/06.Axios 实例模块单元测试.md +++ b/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/06.Axios 实例模块单元测试.md @@ -2,6 +2,8 @@ title: Axios 实例模块单元测试 date: 2020-01-05 10:56:02 permalink: /pages/2eac7a0a0d644c15 +author: + name: HuangYi --- # Axios 实例模块单元测试 diff --git a/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/07.拦截器模块单元测试.md b/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/07.拦截器模块单元测试.md index dbb73a9..be272f3 100644 --- a/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/07.拦截器模块单元测试.md +++ b/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/07.拦截器模块单元测试.md @@ -2,6 +2,8 @@ title: 拦截器模块单元测试 date: 2020-01-05 10:56:02 permalink: /pages/97de6fd6293a2c6e +author: + name: HuangYi --- # 拦截器模块单元测试 diff --git a/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/08.mergeConfig 模块单元测试.md b/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/08.mergeConfig 模块单元测试.md index 8b9426e..dd7dc84 100644 --- a/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/08.mergeConfig 模块单元测试.md +++ b/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/08.mergeConfig 模块单元测试.md @@ -2,6 +2,8 @@ title: mergeConfig 模块单元测试 date: 2020-01-05 10:56:02 permalink: /pages/cdf59840306f9e81 +author: + name: HuangYi --- # mergeConfig 模块单元测试 diff --git a/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/09.请求取消模块单元测试.md b/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/09.请求取消模块单元测试.md index 529b9b9..9b16484 100644 --- a/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/09.请求取消模块单元测试.md +++ b/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/09.请求取消模块单元测试.md @@ -2,6 +2,8 @@ title: 请求取消模块单元测试 date: 2020-01-05 10:56:02 permalink: /pages/6fa16aee29527032 +author: + name: HuangYi --- # 请求取消模块单元测试 diff --git a/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/10.剩余模块单元测试.md b/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/10.剩余模块单元测试.md index 3f585e4..b01aae7 100644 --- a/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/10.剩余模块单元测试.md +++ b/docs/《TypeScript 从零实现 axios》/11.ts-axios 单元测试/10.剩余模块单元测试.md @@ -2,6 +2,8 @@ title: 剩余模块单元测试 date: 2020-01-05 10:56:02 permalink: /pages/9572134781ba6a25 +author: + name: HuangYi --- # 剩余模块单元测试 diff --git a/docs/《TypeScript 从零实现 axios》/12.ts-axios 部署与发布/01.ts-axios 编译与发布.md b/docs/《TypeScript 从零实现 axios》/12.ts-axios 部署与发布/01.ts-axios 编译与发布.md index c90554b..38e86a2 100644 --- a/docs/《TypeScript 从零实现 axios》/12.ts-axios 部署与发布/01.ts-axios 编译与发布.md +++ b/docs/《TypeScript 从零实现 axios》/12.ts-axios 部署与发布/01.ts-axios 编译与发布.md @@ -2,6 +2,8 @@ title: ts-axios 编译与发布 date: 2020-01-05 10:56:02 permalink: /pages/3e5d5a45ad50f198 +author: + name: HuangYi --- # ts-axios 编译与发布 diff --git a/docs/《TypeScript 从零实现 axios》/12.ts-axios 部署与发布/02.引用 ts-axios 库.md b/docs/《TypeScript 从零实现 axios》/12.ts-axios 部署与发布/02.引用 ts-axios 库.md index 8d6b164..afd20a3 100644 --- a/docs/《TypeScript 从零实现 axios》/12.ts-axios 部署与发布/02.引用 ts-axios 库.md +++ b/docs/《TypeScript 从零实现 axios》/12.ts-axios 部署与发布/02.引用 ts-axios 库.md @@ -2,6 +2,8 @@ title: 引用 ts-axios 库 date: 2020-01-05 10:56:02 permalink: /pages/c6bdbd5bd60adf5a +author: + name: HuangYi --- # 引用 ts-axios 库 diff --git a/package.json b/package.json index 6f2fd99..fade39d 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "devDependencies": { "@vuepress/plugin-back-to-top": "^1.2.0", "ejs": "^3.0.1", + "inquirer": "^7.1.0", "json2yaml": "^1.1.0", "md5.js": "^1.3.5", "moment": "^2.24.0", diff --git a/theme-vdoing/components/Home.vue b/theme-vdoing/components/Home.vue index cf5aa49..18ee37e 100644 --- a/theme-vdoing/components/Home.vue +++ b/theme-vdoing/components/Home.vue @@ -1,20 +1,21 @@ - \ No newline at end of file + diff --git a/theme-vdoing/components/Home改变中.vue b/theme-vdoing/components/Home改变中.vue deleted file mode 100644 index 18ee37e..0000000 --- a/theme-vdoing/components/Home改变中.vue +++ /dev/null @@ -1,485 +0,0 @@ - - - - - diff --git a/theme-vdoing/components/Home未改版.vue b/theme-vdoing/components/Home未改版.vue new file mode 100644 index 0000000..cf5aa49 --- /dev/null +++ b/theme-vdoing/components/Home未改版.vue @@ -0,0 +1,468 @@ + + + + + + \ No newline at end of file diff --git a/theme-vdoing/components/Timeline.vue b/theme-vdoing/components/Timeline.vue index 52e9ab8..6da8d25 100644 --- a/theme-vdoing/components/Timeline.vue +++ b/theme-vdoing/components/Timeline.vue @@ -54,9 +54,6 @@ export default { }, mounted() { const fmData = this.$frontmatter.pageComponent.data - if(fmData && fmData.tagBgColor) { - this.pageData.tagBgColor = fmData.tagBgColor - } if(fmData && fmData.slogan) { this.pageData.slogan = fmData.slogan } diff --git a/utils/config.yaml b/utils/config.yaml deleted file mode 100644 index c58d46b..0000000 --- a/utils/config.yaml +++ /dev/null @@ -1,14 +0,0 @@ -#批量添加和修改front matter配置文件 - -# 防止误操作,每次批量修改时手动改成true,修改完成后会自动变成false -editable: true - -# 需要批量处理的路径,docs文件夹内的文件夹 -path: - - 01.前端 - - 25.JavaScript文章 - - # 要写入front matter的数据 -data: - tags: - - js \ No newline at end of file diff --git a/utils/config.yml b/utils/config.yml new file mode 100644 index 0000000..484c140 --- /dev/null +++ b/utils/config.yml @@ -0,0 +1,12 @@ +#批量添加和修改、删除front matter配置文件 + +# 需要批量处理的路径,docs文件夹内的文件夹 +path: + - 《ES6 教程》笔记 + +# delete: true # 是否删除字段操作 + + # 要写入或删除front matter的数据 (front matter中没有的数据则添加,已有的数据则覆盖。如果是删除操作会忽略字段的值。) +data: + author: + name: 阮一峰 \ No newline at end of file diff --git a/utils/editFrontmatter.js b/utils/editFrontmatter.js index 413250a..4f9729e 100644 --- a/utils/editFrontmatter.js +++ b/utils/editFrontmatter.js @@ -1,126 +1,62 @@ /** - * 批量添加和修改front matter + * 批量添加和修改front matter ,需要 ./config.yml 配置文件的配合。 */ const fs = require('fs'); // 文件模块 const path = require('path'); // 路径模块 -const logger = require('tracer').colorConsole(); // 控制台工具(用于控制台打印信息包含时间、打印类型、文件及代码行号、对象、颜色) const matter = require('gray-matter'); // FrontMatter解析器 https://github.com/jonschlinkert/gray-matter const jsonToYaml = require('json2yaml') const yamlToJs = require('yamljs') -const arg = process.argv.splice(2)[0]; // 获取命令行传入的参数 +const inquirer = require('inquirer') // 命令行操作 + const readFileList = require('./modules/readFileList'); +const { type, repairDate} = require('./modules/fn'); -const configFile = require('./config.yaml') +const configPath = path.join(__dirname, 'config.yml') // 配置文件的路径 -// const configStr = fs.readFileSync(, 'utf8'); -console.log(fs.readFileSync(configFile).toString()) -// const configDate = yamlToJs.parse(fs.readFileSync(configFile).toString()) - -// const fm = { -// data: { -// tags: ['js'] -// }, -// path: ['01.前端','25.JavaScript文章22'] -// } - -// console.log(config) - -// const filePath = path.join(__dirname, '..', 'docs', ...config.path); - -// main(); +main(); /** * 主体函数 */ -function main() { +async function main() { + + const promptList = [{ + type: "confirm", + message: "批量操作frontmatter有修改数据的风险,确定要继续吗?", + name: "edit", + }]; + let edit = true; + + await inquirer.prompt(promptList).then(answers => { + edit = answers.edit + }) + + if(!edit) { // 退出操作 + return + } + + const config = yamlToJs.load(configPath) // 解析配置文件的数据转为js对象 + const filePath = path.join(__dirname, '..', 'docs', ...config.path); // 要批量修改的文件路径 const files = readFileList(filePath); // 读取所有md文件数据 - console.log(files) + files.forEach(file => { + let dataStr = fs.readFileSync(file.filePath, 'utf8');// 读取每个md文件的内容 + const fileMatterObj = matter(dataStr) // 解析md文件的front Matter。 fileMatterObj => {content:'剔除frontmatter后的文件内容字符串', data:{}, ...} + let matterData = fileMatterObj.data; // 得到md文件的front Matter - // files.forEach(file => { - // let dataStr = fs.readFileSync(file.filePath, 'utf8');// 读取每个md文件内容 - - // /** - // * fileMatterObj => {content:'剔除frontmatter后的文件内容字符串', data:{}, ...} - // */ - // const fileMatterObj = matter(dataStr); - - // if (Object.keys(fileMatterObj.data).length === 0) { // 未定义FrontMatter数据 - // const stat = fs.statSync(file.filePath); - // const dateStr = dateFormat(stat.birthtime);// 文件的创建时间 - // const newData = `---\r\ntitle: ${file.name}\r\ndate: ${dateStr}\r\npermalink: ${file.permalink}\r\n---\r\n` + fileMatterObj.content; - // fs.writeFileSync(file.filePath, newData); // 写入 - // console.log(`write FrontMatter:${file.filePath} `) - - // } else { // 已有FrontMatter - // const matterData = fileMatterObj.data; - // let mark = false; - - // // 已有FrontMatter,但是没有title、date、permalink数据的 - // if (!matterData.hasOwnProperty('title')) { - // matterData.title = file.name; - // mark = true; - // } - - // if (!matterData.hasOwnProperty('date')) { - // const stat = fs.statSync(file.filePath); - // matterData.date = dateFormat(stat.birthtime); - // mark = true; - // } - - // if (!matterData.hasOwnProperty('permalink')) { - // matterData.permalink = file.permalink; - // mark = true; - // } - - // if (mark) { - // if(matterData.date && type(matterData.date) === 'date') { - // matterData.date = repairDate(matterData.date) // 修复时间格式 - // } - // const newData = jsonToYaml.stringify(matterData).replace(/\n\s{2}/g,"\n") + '---\r\n' + fileMatterObj.content; - // fs.writeFileSync(file.filePath, newData); // 写入 - // console.log(`update FrontMatter:${file.filePath} `) - // } - - - // // 更新title和permalink - // if (arg === '-update' && matterData.title != file.name){ // 当title和文件名不一致时才更新 - // matterData.title = file.name; - // if (/pages/.test(matterData.permalink)) { - // matterData.permalink = file.permalink; - // } - // // 修复date时区和格式被修改的问题 (并非更新date的值) - // matterData.date = repairDate(matterData.date); - - // const newData2 = jsonToYaml.stringify(JSON.parse(JSON.stringify(matterData))) + '---\r\n' + fileMatterObj.content; - // fs.writeFileSync(file.filePath, newData2); // 写入 - // console.log(`update FrontMatter title and permalink:${file.filePath}`) - // } - - // } + if (config.delete == true) { // 删除操作 + for(let key in config.data) { + delete matterData[key] + } + } else { // 添加、修改操作 + Object.assign(matterData, config.data) // 将配置数据合并到front Matter对象 + } - // }) - -} - -// 类型判断 -function type(o){ - var s = Object.prototype.toString.call(o) - return s.match(/\[object (.*?)\]/)[1].toLowerCase() -} - - // 修复date时区格式的问题 -function repairDate(date) { - date = new Date(date); - return `${date.getUTCFullYear()}-${zero(date.getUTCMonth()+1)}-${zero(date.getUTCDate())} ${zero(date.getUTCHours())}:${zero(date.getUTCMinutes())}:${zero(date.getUTCSeconds())}`; -} - -// 日期的格式 -function dateFormat(date) { - return `${date.getFullYear()}-${zero(date.getMonth()+1)}-${zero(date.getDate())} ${zero(date.getHours())}:${zero(date.getMinutes())}:${zero(date.getSeconds())}` -} - -// 小于10补0 -function zero(d){ - return d.toString().padStart(2,'0') + if(matterData.date && type(matterData.date) === 'date') { + matterData.date = repairDate(matterData.date) // 修复时间格式 + } + const newData = jsonToYaml.stringify(matterData).replace(/\n\s{2}/g,"\n").replace(/"/g,"") + '---\r\n' + fileMatterObj.content; + fs.writeFileSync(file.filePath, newData); // 写入 + console.log(`update frontmatter:${file.filePath} `) + }) } diff --git a/utils/frontmatter.js b/utils/frontmatter.js index 521ab6a..4c97f47 100644 --- a/utils/frontmatter.js +++ b/utils/frontmatter.js @@ -7,6 +7,7 @@ const matter = require('gray-matter'); // FrontMatter解析器 https://github.co const jsonToYaml = require('json2yaml') const arg = process.argv.splice(2)[0]; // 获取命令行传入的参数 const readFileList = require('./modules/readFileList'); +const { type, repairDate, dateFormat} = require('./modules/fn'); main(); @@ -29,7 +30,7 @@ function main() { const dateStr = dateFormat(stat.birthtime);// 文件的创建时间 const newData = `---\r\ntitle: ${file.name}\r\ndate: ${dateStr}\r\npermalink: ${file.permalink}\r\n---\r\n` + fileMatterObj.content; fs.writeFileSync(file.filePath, newData); // 写入 - console.log(`write FrontMatter:${file.filePath} `) + console.log(`write frontmatter:${file.filePath} `) } else { // 已有FrontMatter const matterData = fileMatterObj.data; @@ -56,9 +57,9 @@ function main() { if(matterData.date && type(matterData.date) === 'date') { matterData.date = repairDate(matterData.date) // 修复时间格式 } - const newData = jsonToYaml.stringify(matterData).replace(/\n\s{2}/g,"\n") + '---\r\n' + fileMatterObj.content; + const newData = jsonToYaml.stringify(matterData).replace(/\n\s{2}/g,"\n").replace(/"/g,"") + '---\r\n' + fileMatterObj.content; fs.writeFileSync(file.filePath, newData); // 写入 - console.log(`update FrontMatter:${file.filePath} `) + console.log(`update frontmatter:${file.filePath} `) } @@ -71,7 +72,7 @@ function main() { // 修复date时区和格式被修改的问题 (并非更新date的值) matterData.date = repairDate(matterData.date); - const newData2 = jsonToYaml.stringify(JSON.parse(JSON.stringify(matterData))).replace(/\n\s{2}/g,"\n") + '---\r\n' + fileMatterObj.content; + const newData2 = jsonToYaml.stringify(JSON.parse(JSON.stringify(matterData))).replace(/\n\s{2}/g,"\n").replace(/"/g,"") + '---\r\n' + fileMatterObj.content; fs.writeFileSync(file.filePath, newData2); // 写入 console.log(`update FrontMatter title and permalink:${file.filePath}`) } @@ -82,24 +83,4 @@ function main() { } -// 类型判断 -function type(o){ - var s = Object.prototype.toString.call(o) - return s.match(/\[object (.*?)\]/)[1].toLowerCase() -} - // 修复date时区格式的问题 -function repairDate(date) { - date = new Date(date); - return `${date.getUTCFullYear()}-${zero(date.getUTCMonth()+1)}-${zero(date.getUTCDate())} ${zero(date.getUTCHours())}:${zero(date.getUTCMinutes())}:${zero(date.getUTCSeconds())}`; -} - -// 日期的格式 -function dateFormat(date) { - return `${date.getFullYear()}-${zero(date.getMonth()+1)}-${zero(date.getDate())} ${zero(date.getHours())}:${zero(date.getMinutes())}:${zero(date.getSeconds())}` -} - -// 小于10补0 -function zero(d){ - return d.toString().padStart(2,'0') -} diff --git a/utils/modules/fn.js b/utils/modules/fn.js new file mode 100644 index 0000000..48cbbd1 --- /dev/null +++ b/utils/modules/fn.js @@ -0,0 +1,21 @@ +// 类型判断 +exports.type = function (o){ + var s = Object.prototype.toString.call(o) + return s.match(/\[object (.*?)\]/)[1].toLowerCase() +} + + // 修复date时区格式的问题 + exports.repairDate = function (date) { + date = new Date(date); + return `${date.getUTCFullYear()}-${zero(date.getUTCMonth()+1)}-${zero(date.getUTCDate())} ${zero(date.getUTCHours())}:${zero(date.getUTCMinutes())}:${zero(date.getUTCSeconds())}`; +} + +// 日期的格式 +exports.dateFormat = function (date) { + return `${date.getFullYear()}-${zero(date.getMonth()+1)}-${zero(date.getDate())} ${zero(date.getHours())}:${zero(date.getMinutes())}:${zero(date.getSeconds())}` +} + +// 小于10补0 +function zero(d){ + return d.toString().padStart(2,'0') +} \ No newline at end of file