--- jd-id: "01.08" name: "src-utils" desc: "Cross-cutting helpers used by router, stores, and views." author: "Clark Lin" updateTime: "2026-07-06" status: active type: "A-高层系统" tags: - 前端 - Utilities --- ## Core Files | File path | Role | |-----------|------| | `src/utils/lanAccess.js` | Exports `isLanAccess()` — detected by inspecting `window.location.hostname` against private IPv4 ranges (e.g. `10.*`, `192.168.*`, `172.16–31.*`) so the router guard can skip the JWT requirement during local development. | --- ## Conventions - Utilities are imported with the `@/` alias (see `vite.config.js`) — e.g. `import { isLanAccess } from '@/utils/lanAccess'`. - Keep helpers pure and dependency-free; place anything stateful inside a Pinia store instead. --- Home: [[01.00 student-app-frontend]] | **Location:** `C:\Projects\vue\student-app-frontend\src\utils`