Skip to content

Commit 980c039

Browse files
author
litongjava
committed
add production config
1 parent ce5beaa commit 980c039

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

ui/src/request/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import router from '@/router'
99
import { ref, type WritableComputedRef } from 'vue'
1010

1111
const axiosConfig = {
12-
baseURL: '/api',
12+
baseURL: import.meta.env.VITE_API_BASE_URL || '/api',
1313
withCredentials: false,
1414
timeout: 600000,
1515
headers: {}

ui/src/router/index.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
import { hasPermission } from '@/utils/permission/index'
1+
import {hasPermission} from '@/utils/permission/index'
22
import {
33
createRouter,
4-
createWebHistory,
4+
createWebHashHistory,
55
type NavigationGuardNext,
66
type RouteLocationNormalized,
7-
type RouteRecordRaw,
8-
type RouteRecordName
7+
type RouteRecordName,
8+
type RouteRecordRaw
99
} from 'vue-router'
1010
import useStore from '@/stores'
11-
import { routes } from '@/router/routes'
11+
import {routes} from '@/router/routes'
12+
1213
const router = createRouter({
13-
history: createWebHistory(import.meta.env.BASE_URL),
14+
history: createWebHashHistory(import.meta.env.BASE_URL),
1415
routes: routes
1516
})
1617

ui/vite.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ import DefineOptions from 'unplugin-vue-define-options/vite'
88
const envDir = './env'
99
// https://vitejs.dev/config/
1010
export default defineConfig(({ mode }) => {
11+
console.log('Current Mode:', mode);
12+
console.log('Loading Environment Variables from:', process.cwd());
1113
const ENV = loadEnv(mode, envDir)
14+
console.log('Loaded ENV:', ENV);
1215
const prefix = process.env.VITE_DYNAMIC_PREFIX || ENV.VITE_BASE_PATH;
1316
const proxyConf: Record<string, string | ProxyOptions> = {}
1417
proxyConf['/api'] = {

0 commit comments

Comments
 (0)