feat: hot reload

This commit is contained in:
2025-12-17 09:32:05 +08:00
parent e8b2699104
commit f2b53967eb
7 changed files with 95 additions and 32 deletions

View File

@@ -11,6 +11,6 @@ export function getAdminRouterBase(pathname = window.location.pathname): string
export function getApiBaseURL(pathname = window.location.pathname): string {
const tenantCode = getTenantCodeFromPath(pathname)
return `/t/${tenantCode}/v1`
const origin = import.meta.env.DEV ? 'http://localhost:8080' : ''
return `${origin}/t/${tenantCode}/v1`
}

View File

@@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>QuyUn Super Admin</title>
<script type="module" crossorigin src="./assets/index-CHzhCW76.js"></script>
<script type="module" crossorigin src="./assets/index-BJ_2zMy4.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index-B1dbpKz4.css">
</head>
<body>

View File

@@ -1,7 +1,8 @@
import axios from 'axios'
import { getToken, setToken } from './auth'
export const api = axios.create({ baseURL: '/super/v1' })
const baseURL = import.meta.env.DEV ? 'http://localhost:8080/super/v1' : '/super/v1'
export const api = axios.create({ baseURL })
api.interceptors.request.use((config) => {
const token = getToken()

View File

@@ -11,6 +11,6 @@ export function getUserRouterBase(pathname = window.location.pathname): string {
export function getApiBaseURL(pathname = window.location.pathname): string {
const tenantCode = getTenantCodeFromPath(pathname)
return `/t/${tenantCode}/v1`
const origin = import.meta.env.DEV ? 'http://localhost:8080' : ''
return `${origin}/t/${tenantCode}/v1`
}