Merge branch 'dev' of github.com:tbphp/gpt-load into dev

This commit is contained in:
tbphp
2025-07-03 17:54:08 +08:00
2 changed files with 28 additions and 24 deletions

View File

@@ -29,7 +29,6 @@ const handleLogin = async () => {
<template> <template>
<div class="login-container"> <div class="login-container">
<n-card class="login-card" title="登录"> <n-card class="login-card" title="登录">
<div>auth: {{ authKey }}</div>
<n-space vertical> <n-space vertical>
<n-input <n-input
v-model:value="authKey" v-model:value="authKey"

View File

@@ -1,30 +1,35 @@
import vue from "@vitejs/plugin-vue"; import vue from "@vitejs/plugin-vue";
import path from "path"; import path from "path";
import { defineConfig } from "vite"; import { defineConfig, loadEnv } from "vite";
// https://vite.dev/config/ // https://vite.dev/config/
export default defineConfig({ export default defineConfig(({ mode }) => {
plugins: [vue()], // 加载环境变量
// 解析配置 const env = loadEnv(mode, path.resolve(__dirname, "../"), "");
resolve: {
// 配置路径别名 return {
alias: { plugins: [vue()],
"@": path.resolve(__dirname, "./src"), // 解析配置
}, resolve: {
}, // 配置路径别名
// 开发服务器配置 alias: {
server: { "@": path.resolve(__dirname, "./src"),
// 代理配置示例
proxy: {
"/api": {
target: "http://localhost:3000",
changeOrigin: true,
}, },
}, },
}, // 开发服务器配置
// 构建配置 server: {
build: { // 代理配置示例
outDir: "../cmd/gpt-load/dist", proxy: {
assetsDir: "assets", "/api": {
}, target: env.VITE_API_BASE_URL,
changeOrigin: true,
},
},
},
// 构建配置
build: {
outDir: "../cmd/gpt-load/dist",
assetsDir: "assets",
},
};
}); });