README
@umijs/max 模板项目,更多功能参考 Umi Max 简介
Language Switching
- Lang toggle components (
src/components/switch/LangSwitches.tsx,src/components/LanguageSwitcher/index.tsx) call UmisetLocale(newLocale, false)so content re-renders instantly without refreshing the page. - Both components listen for the browser
languagechangeevent to keep their UI state in sync when another part of the app switches languages. - Strings are translated via
useTranslation/useIntl; ensure new labels have entries insrc/locales/en-US.tsandsrc/locales/vi-VN.ts.
Proxy & Request Profiles
- Project uses two sets of configs under
config/:proxy.ts+Request.tsfor local development API targets.proxy_prod.ts+request_prod.tsfor production-like targets.
- The runtime selects configs automatically:
pnpm run dev/ any dev server run ⇒NODE_ENV=development⇒ uses dev proxy/request.pnpm run build(and other production builds) ⇒NODE_ENV=production⇒ uses prod proxy/request.
- Override the environment by exporting
REACT_APP_ENVbefore running commands (values:dev,test,prod). Example:
# Use test upstreams in a dev session
REACT_APP_ENV=test pnpm run dev
# Build with testing endpoints
NODE_ENV=production REACT_APP_ENV=test pnpm run build
config/proxy_prod.tsresolves targets dynamically based on the current hostname; adjust rules there if deployment hosts change.- Request pipelines differ per mode:
config/request_dev.tskeeps relative URLs so calls pass through the dev proxy setup (use when mocking/pointing to LAN services).config/request_prod.tsbuilds absolute URLs fromApiConfigServiceso static builds call the correct host without relying on the proxy.
Verifying Builds
- After switching language, confirm UI updates immediately and check console for
languagechangeevents. - For proxy changes, inspect network requests in devtools to ensure they hit the expected environment.
- Run
pnpm run build && pnpm serve(or your hosting preview) to validate prod settings before deploying.
Description
SeagateWay Device v1.2.3
Latest
Languages
TypeScript
99.5%
Less
0.4%