Configuration
Environment variables
Vite merges .env, .env.development, and .env.production. Every VITE_ variable is exposed to browser code, so never store secrets or private keys in these files.
| Variable | Purpose |
|---|---|
VITE_API_URL | Main production API base URL |
VITE_BASE_URL | Application deployment base path |
VITE_TOKEN_KEY | localStorage token key |
VITE_NEW_TOKEN_KEY | Token-renewal response header |
VITE_WITH_CREDENTIALS | Whether cross-origin requests carry cookies |
VITE_API_URL_LOCAL | Separate trusted service URL |
VITE_API_URL_EXTERNAL | Third-party service URL without the system token |
dotenv
VITE_API_URL=https://api.example.com/
VITE_BASE_URL=/admin/
VITE_TOKEN_KEY=admin_token
VITE_NEW_TOKEN_KEY=New-Access-Token
VITE_WITH_CREDENTIALS=falsePaths
- API base URLs should end with
/. - A menu
componentis relative tosrc/views/, for exampleauth/user/index.vue. - Vite and Vue Router must share the same
VITE_BASE_URL. - External links and iframe URLs should be restricted to trusted origins.
Theme settings
System information is loaded from the system information API. Theme defaults live in src/stores/settings.ts, persist to localStorage, and synchronize across browser tabs. When adding persistent fields, update defaults and the settings schema migration.