mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
fix: 移除统计&添加环境变量
This commit is contained in:
1
napcat.webui/.env
Normal file
1
napcat.webui/.env
Normal file
@@ -0,0 +1 @@
|
||||
VITE_DEBUG_BACKEND_URL="http://127.0.0.1:6099"
|
@@ -13,8 +13,6 @@
|
||||
content="viewport-fit=cover, width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"
|
||||
name="viewport" />
|
||||
<link href="/favicon.ico" rel="icon" />
|
||||
<script defer src="https://umami.napneko.icu/script.js"
|
||||
data-website-id="0502515d-e241-4191-9bd0-ce2a1c13f8fb"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
9
napcat.webui/vite-env.d.ts
vendored
Normal file
9
napcat.webui/vite-env.d.ts
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_DEBUG_BACKEND_URL: string
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv
|
||||
}
|
@@ -1,14 +1,19 @@
|
||||
import react from '@vitejs/plugin-react'
|
||||
import path from 'node:path'
|
||||
import { defineConfig, normalizePath } from 'vite'
|
||||
import { defineConfig, loadEnv, normalizePath } from 'vite'
|
||||
import { viteStaticCopy } from 'vite-plugin-static-copy'
|
||||
import tsconfigPaths from 'vite-tsconfig-paths'
|
||||
|
||||
const monacoEditorPath = normalizePath(
|
||||
path.resolve(__dirname, 'node_modules/monaco-editor/min/vs')
|
||||
)
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd())
|
||||
const backendDebugUrl = env.VITE_DEBUG_BACKEND_URL
|
||||
console.log('backendDebugUrl', backendDebugUrl)
|
||||
return {
|
||||
plugins: [
|
||||
react(),
|
||||
tsconfigPaths(),
|
||||
@@ -24,8 +29,7 @@ export default defineConfig({
|
||||
base: '/webui/',
|
||||
server: {
|
||||
proxy: {
|
||||
'/api': 'http://192.168.30.10:6099'
|
||||
// '/api': 'http://127.0.0.1:6099'
|
||||
'/api': backendDebugUrl
|
||||
}
|
||||
},
|
||||
build: {
|
||||
@@ -44,4 +48,5 @@ export default defineConfig({
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user