docker替换变量,只在production环境进行处理
This commit is contained in:
+8
-4
@@ -7,14 +7,18 @@
|
||||
<title>应急就医服务中心</title>
|
||||
<!-- 全局配置 -->
|
||||
<script>
|
||||
// 默认值(可选)
|
||||
window.__APP_ENV__ = {
|
||||
VITE_GLOB_API_URL: '__VITE_GLOB_API_URL__', // 占位符,Docker 替换
|
||||
};
|
||||
// // 默认值(可选)
|
||||
// window.__APP_ENV__ = {
|
||||
// VITE_GLOB_API_URL: '__VITE_GLOB_API_URL__', // 占位符,Docker 替换
|
||||
// };
|
||||
window._AMapSecurityConfig = {
|
||||
securityJsCode: "1b3b86585c863d22db1e7f7636a9e495",
|
||||
}
|
||||
</script>
|
||||
<!-- __APP_ENV__ 由 Vite 在构建时注入 -->
|
||||
<!-- 开发环境:不注入或注入空值 -->
|
||||
<!-- 生产环境:注入真实值(或占位符供 Docker 替换) -->
|
||||
<!-- __INJECT_APP_ENV__ -->
|
||||
</head>
|
||||
<style>
|
||||
html, body, #app {
|
||||
|
||||
Reference in New Issue
Block a user