Commit 6309b21d authored by 张烨's avatar 张烨

fix: fix bug

parent acdb096d
...@@ -68,9 +68,10 @@ module.exports = function addDevMiddlewares(app, webpackConfig) { ...@@ -68,9 +68,10 @@ module.exports = function addDevMiddlewares(app, webpackConfig) {
const match = proxy2.match(reg); const match = proxy2.match(reg);
const [, pre, host] = match; const [, pre, host] = match;
logger.info(`using proxy2 at: ${host}`); logger.info(`using proxy2 at: ${host}`);
logger.info(`proxy2 prefix: ${pre}`); const prefix = `${pre[0] === '/' ? pre : `/${pre}`}`;
logger.info(`proxy2 prefix: ${prefix}`);
app.use( app.use(
`${pre.indexOf(0) === '/' ? pre : `/${pre}`}`, prefix,
createProxyMiddleware({ createProxyMiddleware({
target: host, target: host,
changeOrigin: true, changeOrigin: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment