File tree Expand file tree Collapse file tree 4 files changed +26
-0
lines changed Expand file tree Collapse file tree 4 files changed +26
-0
lines changed Original file line number Diff line number Diff line change 1+ # 只在开发模式中被载入
2+
3+ # 网站前缀
4+ VITE_BASE_URL = /
5+
6+ # API - 本地通过/api代理
7+ VITE_API_URL = ' /api'
Original file line number Diff line number Diff line change 1+ # 只在生产模式中被载入
2+
3+ # 网站前缀
4+ VITE_BASE_URL = https://cloud-app.com.cn/
5+
6+ # API
7+ VITE_API_URL = ' https://cloud-app.com.cn/'
Original file line number Diff line number Diff line change 11/// <reference types="vite/client" />
2+ interface ImportMetaEnv {
3+ readonly BASE_URL : string
4+ readonly MODE : string
5+ readonly VITE_BASE_URL : string
6+ readonly VITE_API_URL : string
7+ }
8+
9+ interface ImportMeta {
10+ readonly env : ImportMetaEnv
11+ }
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ app.use(createPinia())
1212app . use ( router )
1313
1414console . log ( import . meta. env )
15+ console . log ( import . meta. env . VITE_BASE_URL )
16+
1517// @ts -ignore
1618console . log ( process . env )
1719
You can’t perform that action at this time.
0 commit comments