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
@@ -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}`