refactor: more comprehensive dev and prod env isolation and build process

This commit is contained in:
pk5ls20
2024-11-16 06:10:36 +08:00
parent e98910c9ff
commit 609e83a824
18 changed files with 62 additions and 3995 deletions

View File

@@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="./vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue + TS</title>
<title>NapCat WebUI</title>
</head>
<body>
<div id="app"></div>

View File

@@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"webui:lint": "eslint . --fix",
"webui:dev": "vite --host 127.0.0.1",
"webui:dev": "vite",
"webui:build": "vue-tsc -b && vite build",
"webui:preview": "vite preview"
},

View File

@@ -3,9 +3,9 @@ import { OneBotConfig } from '../../../src/onebot/config/config';
export class QQLoginManager {
private retCredential: string;
private readonly apiPrefix: string;
// TODO:
//调试时http://127.0.0.1:6099/api 打包时 ../api
constructor(retCredential: string, apiPrefix: string = 'http://127.0.0.1:6099/api') {
constructor(retCredential: string, apiPrefix: string = '../api') {
this.retCredential = retCredential;
this.apiPrefix = apiPrefix;
}

View File

@@ -11,4 +11,9 @@ export default defineConfig({
'@': path.resolve(__dirname, 'src'),
},
},
server: {
proxy: {
'/api': 'http://localhost:6099',
},
},
});