mirror of https://github.com/halo-dev/halo-admin
refactor: set the root path of the development environment to /console (#638)
#### What type of PR is this? /kind improvement /milestone 2.0 #### What this PR does / why we need it: 将开发环境的访问根路径改为 `/console`,即 `http://localhost:3000/console`,方便后续 Halo 对此地址进行反向代理,保证同源。 #### Special notes for your reviewer: /cc @halo-dev/sig-halo-console 测试方式:启动之后访问 <http://localhost:3000/console>,检查控制台是否有资源加载异常。 #### Does this PR introduce a user-facing change? ```release-note None ```pull/641/head
parent
170c027bfe
commit
8b15196a33
|
@ -1,2 +1,2 @@
|
|||
VITE_API_URL=http://localhost:8090
|
||||
VITE_BASE_URL=/
|
||||
VITE_BASE_URL=/console/
|
||||
|
|
|
@ -69,6 +69,16 @@ export const setupLibraryExternal = (
|
|||
},
|
||||
];
|
||||
|
||||
const injectScript = staticTargets
|
||||
.map((target) => {
|
||||
return `<script src="${isProduction ? baseUrl : "/"}${target.dest}/${
|
||||
target.rename
|
||||
}"></script>`;
|
||||
})
|
||||
.join("\n");
|
||||
|
||||
console.log(injectScript);
|
||||
|
||||
return [
|
||||
ViteExternals({
|
||||
vue: "Vue",
|
||||
|
@ -86,11 +96,7 @@ export const setupLibraryExternal = (
|
|||
minify: false,
|
||||
inject: {
|
||||
data: {
|
||||
injectScript: staticTargets
|
||||
.map((target) => {
|
||||
return `<script src="${baseUrl}${target.dest}/${target.rename}"></script>`;
|
||||
})
|
||||
.join("\n"),
|
||||
injectScript,
|
||||
},
|
||||
},
|
||||
}),
|
||||
|
|
Loading…
Reference in New Issue