From 619acae65d047ae08d55d9c68ffbf48af94d2ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E7=BA=AF?= Date: Thu, 25 Mar 2021 21:37:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20base=E9=BB=98=E8=AE=A4=E5=BA=94=E8=AF=A5?= =?UTF-8?q?=E6=98=AF=E7=A9=BA=E5=AD=97=E7=AC=A6=E4=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/create-fes-app/templates/app/pc/.fes.js | 2 +- packages/fes-plugin-qiankun/src/main/index.js | 2 +- packages/fes-preset-built-in/src/plugins/features/base.js | 4 ++-- packages/fes-preset-built-in/src/plugins/misc/route/index.js | 2 +- packages/fes-template/.fes.js | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/create-fes-app/templates/app/pc/.fes.js b/packages/create-fes-app/templates/app/pc/.fes.js index db77aa6f..03ee6f39 100644 --- a/packages/create-fes-app/templates/app/pc/.fes.js +++ b/packages/create-fes-app/templates/app/pc/.fes.js @@ -2,7 +2,7 @@ export default { - base: '/foo/', + base: '', define: { __DEV__: false }, diff --git a/packages/fes-plugin-qiankun/src/main/index.js b/packages/fes-plugin-qiankun/src/main/index.js index 2caea696..5ee3f2d1 100644 --- a/packages/fes-plugin-qiankun/src/main/index.js +++ b/packages/fes-plugin-qiankun/src/main/index.js @@ -80,7 +80,7 @@ export default function (api) { const { main: options } = api.config?.qiankun || {}; const masterHistoryType = api.config?.router?.mode || defaultHistoryType; - const base = api.config.base || '/'; + const base = api.config.base; api.writeTmpFile({ path: absMasterOptionsPath, content: ` diff --git a/packages/fes-preset-built-in/src/plugins/features/base.js b/packages/fes-preset-built-in/src/plugins/features/base.js index bb956489..42e4f239 100644 --- a/packages/fes-preset-built-in/src/plugins/features/base.js +++ b/packages/fes-preset-built-in/src/plugins/features/base.js @@ -3,9 +3,9 @@ export default (api) => { api.describe({ key: 'base', config: { - default: '/', + default: '', schema(joi) { - return joi.string(); + return joi.string().allow(''); } } }); diff --git a/packages/fes-preset-built-in/src/plugins/misc/route/index.js b/packages/fes-preset-built-in/src/plugins/misc/route/index.js index c51e709e..5aea8a18 100644 --- a/packages/fes-preset-built-in/src/plugins/misc/route/index.js +++ b/packages/fes-preset-built-in/src/plugins/misc/route/index.js @@ -280,7 +280,7 @@ export default function (api) { runtimePath, routes, config: api.config, - routerBase: api.config.base || '', + routerBase: api.config.base, CREATE_HISTORY: historyType[api.config.router.mode] || 'createWebHashHistory' }) }); diff --git a/packages/fes-template/.fes.js b/packages/fes-template/.fes.js index e0f64071..6ffe3d69 100644 --- a/packages/fes-template/.fes.js +++ b/packages/fes-template/.fes.js @@ -2,7 +2,7 @@ export default { - base: '/foo/', + base: '', define: { __DEV__: false }, @@ -12,7 +12,7 @@ export default { publicPath: '/', access: { roles: { - admin: ["/", "https://www.baidu.com"] + admin: ["/", "/store", "https://www.baidu.com"] } }, request: {