diff --git a/frontend/src/pages/portal/EmployeeHome.tsx b/frontend/src/pages/portal/EmployeeHome.tsx index db4ddba..1a5596a 100644 --- a/frontend/src/pages/portal/EmployeeHome.tsx +++ b/frontend/src/pages/portal/EmployeeHome.tsx @@ -11,9 +11,10 @@ import { } from 'lucide-react' import Card from '../../components/ui/Card' import { InlineAlert } from '../../components/ui/InlineAlert' +import axios from 'axios' /** 员工端 API 实例(自动携带 portalToken) */ -const portalApi = (await import('../../lib/api')).default.create({ baseURL: '/api/v1/portal' }) +const portalApi = axios.create({ baseURL: '/api/v1/portal' }) portalApi.interceptors.request.use((config: any) => { const token = localStorage.getItem('portalToken') if (token) config.headers.Authorization = `Bearer ${token}` diff --git a/frontend/src/pages/portal/OnboardingProgress.tsx b/frontend/src/pages/portal/OnboardingProgress.tsx index f3bd2d8..7b95468 100644 --- a/frontend/src/pages/portal/OnboardingProgress.tsx +++ b/frontend/src/pages/portal/OnboardingProgress.tsx @@ -7,9 +7,10 @@ import { Check, Clock, AlertCircle, FileText, Upload, User, Phone, Banknote } fr import Card from '../../components/ui/Card' import { InlineAlert } from '../../components/ui/InlineAlert' import { Stepper } from '../../components/ui/Stepper' +import axios from 'axios' /** 员工端 API 实例 */ -const portalApi = (await import('../../lib/api')).default.create({ baseURL: '/api/v1/portal' }) +const portalApi = axios.create({ baseURL: '/api/v1/portal' }) portalApi.interceptors.request.use((config: any) => { const token = localStorage.getItem('portalToken') if (token) config.headers.Authorization = `Bearer ${token}` diff --git a/frontend/src/pages/portal/ResignationApply.tsx b/frontend/src/pages/portal/ResignationApply.tsx index cac4e45..c664b72 100644 --- a/frontend/src/pages/portal/ResignationApply.tsx +++ b/frontend/src/pages/portal/ResignationApply.tsx @@ -9,9 +9,10 @@ import Card from '../../components/ui/Card' import Button from '../../components/ui/Button' import { Input, Label, Select } from '../../components/ui/Input' import { InlineAlert } from '../../components/ui/InlineAlert' +import axios from 'axios' /** 员工端 API 实例 */ -const portalApi = (await import('../../lib/api')).default.create({ baseURL: '/api/v1/portal' }) +const portalApi = axios.create({ baseURL: '/api/v1/portal' }) portalApi.interceptors.request.use((config: any) => { const token = localStorage.getItem('portalToken') if (token) config.headers.Authorization = `Bearer ${token}`