From 183804762492c70238e1ac497f142e1ded0ad45f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E7=BA=AF?= Date: Mon, 8 Mar 2021 20:49:35 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=AD=A3=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/guide/env.md | 10 +++++----- docs/guide/runtime-config.md | 17 ----------------- docs/reference/api/README.md | 4 ++-- docs/zh/guide/env.md | 10 +++++----- docs/zh/guide/runtime-config.md | 15 +-------------- docs/zh/reference/api/README.md | 4 ++-- 6 files changed, 15 insertions(+), 45 deletions(-) diff --git a/docs/guide/env.md b/docs/guide/env.md index 04c928ad..dde8b29f 100644 --- a/docs/guide/env.md +++ b/docs/guide/env.md @@ -8,10 +8,10 @@ 比如: ```bash # OS X, Linux -PORT=3000 umi dev +PORT=3000 fes dev # Windows (cmd.exe) -set PORT=3000 && umi dev +set PORT=3000 && fes dev ``` 如果要同时考虑 OS X 和 Windows,可借助三方工具 [cross-env](https://github.com/kentcdodds/cross-env) @@ -19,7 +19,7 @@ set PORT=3000 && umi dev ```bash yarn add cross-env --dev -cross-env PORT=3000 umi dev +cross-env PORT=3000 fes dev ``` @@ -27,7 +27,7 @@ cross-env PORT=3000 umi dev ```bash npm i cross-env --save-dev -cross-env PORT=3000 umi dev +cross-env PORT=3000 fes dev ``` @@ -54,7 +54,7 @@ fes dev 举个 🌰 : ```bash -FES_ENV=sit umi dev +FES_ENV=sit fes dev ``` 如果存在 `.env.sit` 文件,则会将 `.env.sit` 的配置和 `.env` 做 `merge` 后形成最终配置。 diff --git a/docs/guide/runtime-config.md b/docs/guide/runtime-config.md index aa773ebb..e3fb876a 100644 --- a/docs/guide/runtime-config.md +++ b/docs/guide/runtime-config.md @@ -127,23 +127,6 @@ render(oldRender: Function) 覆写 render。 -比如用于渲染之前做权限校验: -```js -import { history } from 'umi'; - -export function render(oldRender) { - fetch('/api/auth').then(auth => { - if (auth.isLogin) { oldRender() } - else { - history.push('/login'); - oldRender() - } - }); -} -``` - - - ### onRouterCreated onRouterCreated({router}) diff --git a/docs/reference/api/README.md b/docs/reference/api/README.md index 10c76697..74469259 100644 --- a/docs/reference/api/README.md +++ b/docs/reference/api/README.md @@ -15,9 +15,9 @@ import { someApi } from "@fesjs/fes" 主要在插件里面使用,项目代码中一般用不到。 ::: -运行时插件接口,是 Umi 内置的跑在浏览器里的一套插件体系。 +运行时插件接口,是 Fes.js 内置的跑在浏览器里的一套插件体系。 ```js -import { plugin, ApplyPluginsType } from 'umi'; +import { plugin, ApplyPluginsType } from '@fesjs/fes'; // 注册插件 plugin.register({ diff --git a/docs/zh/guide/env.md b/docs/zh/guide/env.md index 04c928ad..dde8b29f 100644 --- a/docs/zh/guide/env.md +++ b/docs/zh/guide/env.md @@ -8,10 +8,10 @@ 比如: ```bash # OS X, Linux -PORT=3000 umi dev +PORT=3000 fes dev # Windows (cmd.exe) -set PORT=3000 && umi dev +set PORT=3000 && fes dev ``` 如果要同时考虑 OS X 和 Windows,可借助三方工具 [cross-env](https://github.com/kentcdodds/cross-env) @@ -19,7 +19,7 @@ set PORT=3000 && umi dev ```bash yarn add cross-env --dev -cross-env PORT=3000 umi dev +cross-env PORT=3000 fes dev ``` @@ -27,7 +27,7 @@ cross-env PORT=3000 umi dev ```bash npm i cross-env --save-dev -cross-env PORT=3000 umi dev +cross-env PORT=3000 fes dev ``` @@ -54,7 +54,7 @@ fes dev 举个 🌰 : ```bash -FES_ENV=sit umi dev +FES_ENV=sit fes dev ``` 如果存在 `.env.sit` 文件,则会将 `.env.sit` 的配置和 `.env` 做 `merge` 后形成最终配置。 diff --git a/docs/zh/guide/runtime-config.md b/docs/zh/guide/runtime-config.md index aa773ebb..ff96aa18 100644 --- a/docs/zh/guide/runtime-config.md +++ b/docs/zh/guide/runtime-config.md @@ -127,20 +127,7 @@ render(oldRender: Function) 覆写 render。 -比如用于渲染之前做权限校验: -```js -import { history } from 'umi'; - -export function render(oldRender) { - fetch('/api/auth').then(auth => { - if (auth.isLogin) { oldRender() } - else { - history.push('/login'); - oldRender() - } - }); -} -``` +比如用于渲染之前做权限校验。 diff --git a/docs/zh/reference/api/README.md b/docs/zh/reference/api/README.md index 10c76697..74469259 100644 --- a/docs/zh/reference/api/README.md +++ b/docs/zh/reference/api/README.md @@ -15,9 +15,9 @@ import { someApi } from "@fesjs/fes" 主要在插件里面使用,项目代码中一般用不到。 ::: -运行时插件接口,是 Umi 内置的跑在浏览器里的一套插件体系。 +运行时插件接口,是 Fes.js 内置的跑在浏览器里的一套插件体系。 ```js -import { plugin, ApplyPluginsType } from 'umi'; +import { plugin, ApplyPluginsType } from '@fesjs/fes'; // 注册插件 plugin.register({