fix: 修复 portal 页面 top-level await 导致生产构建失败

This commit is contained in:
selfrelease
2026-08-01 07:19:39 +08:00
parent 6b0fee64d5
commit 26147fa990
3 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -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}`
@@ -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}`
@@ -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}`