From 2c3eae47aca3900527939169e550c3e65a4b8a36 Mon Sep 17 00:00:00 2001
From: wangxiaowei <1121133807@qq.com>
Date: Thu, 16 Apr 2026 17:34:37 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.test | 1 +
src/config/index.ts | 3 +-
src/views/teamaster_user/index.vue | 24 ++---
vite.config.ts | 139 +++++++++++++++--------------
4 files changed, 86 insertions(+), 81 deletions(-)
create mode 100644 .env.test
diff --git a/.env.test b/.env.test
new file mode 100644
index 0000000..6e79810
--- /dev/null
+++ b/.env.test
@@ -0,0 +1 @@
+VITE_APP_BASE_URL=https://test1.stnav.com
\ No newline at end of file
diff --git a/src/config/index.ts b/src/config/index.ts
index edda028..f8cdcdc 100644
--- a/src/config/index.ts
+++ b/src/config/index.ts
@@ -5,8 +5,7 @@ const config = {
// 开发环境使用相对路径(通过代理),生产环境使用完整URL
baseUrl: import.meta.env.DEV
? '/'
- : `${import.meta.env.VITE_APP_BASE_URL || 'https://test1.stnav.com'}/`, //请求接口域名
- // : `${import.meta.env.VITE_APP_BASE_URL || 'https://76458.com'}/`, //请求接口域名
+ : `${import.meta.env.VITE_APP_BASE_URL}/`, //请求接口域名
urlPrefix: 'adminapi', //请求默认前缀
timeout: 10 * 1000 //请求超时时长
}
diff --git a/src/views/teamaster_user/index.vue b/src/views/teamaster_user/index.vue
index 1896852..db625f1 100644
--- a/src/views/teamaster_user/index.vue
+++ b/src/views/teamaster_user/index.vue
@@ -91,15 +91,20 @@
-
-
-
+
+
+
+
+
+
+
+
-
-
+
+
@@ -121,7 +126,7 @@
-
+
@@ -143,12 +148,7 @@
-
-
-
-
-
-
+
编辑
diff --git a/vite.config.ts b/vite.config.ts
index f1235fc..042f1be 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -6,7 +6,7 @@ import AutoImport from 'unplugin-auto-import/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import Components from 'unplugin-vue-components/vite'
import { fileURLToPath, URL } from 'url'
-import { defineConfig } from 'vite'
+import { defineConfig, loadEnv } from 'vite'
import { createStyleImportPlugin, ElementPlusResolve } from 'vite-plugin-style-import'
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
import vueSetupExtend from 'vite-plugin-vue-setup-extend'
@@ -36,78 +36,83 @@ function getElementPlusStylePaths() {
return stylePaths
}
-export default defineConfig({
- base: '/admin/',
- server: {
- host: '0.0.0.0',
- port: 5174, // 修改端口号,如有需要可调整
- hmr: true,
- open: true,
- proxy: {
- '/adminapi': {
- target: 'https://test1.stnav.com',
- // target: 'https://76458.com',
- changeOrigin: true,
- secure: true,
- rewrite: (path) => path
+export default defineConfig(({ mode }) => {
+ const env = loadEnv(mode, process.cwd())
+ const targetUrl = env.VITE_APP_BASE_URL || 'https://test1.stnav.com'
+
+ return {
+ base: '/parten/',
+ server: {
+ host: '0.0.0.0',
+ port: 5175, // 修改端口号,如有需要可调整
+ hmr: true,
+ open: true,
+ proxy: {
+ '/adminapi/': {
+ target: targetUrl,
+ // target: 'https://76458.com',
+ changeOrigin: true,
+ secure: true,
+ rewrite: (path) => path
+ }
}
- }
- },
- plugins: [
- vue(),
- vueJsx(),
- AutoImport({
- imports: ['vue', 'vue-router'],
- resolvers: [ElementPlusResolver()],
- eslintrc: {
- enabled: true
+ },
+ plugins: [
+ vue(),
+ vueJsx(),
+ AutoImport({
+ imports: ['vue', 'vue-router'],
+ resolvers: [ElementPlusResolver()],
+ eslintrc: {
+ enabled: true
+ }
+ }),
+ Components({
+ directoryAsNamespace: true,
+ resolvers: [ElementPlusResolver()]
+ }),
+ createStyleImportPlugin({
+ resolves: [ElementPlusResolve()]
+ }),
+ createSvgIconsPlugin({
+ // 配置路劲在你的src里的svg存放文件
+ iconDirs: [fileURLToPath(new URL('./src/assets/icons', import.meta.url))],
+ symbolId: 'local-icon-[dir]-[name]'
+ }),
+ vueSetupExtend()
+ ],
+ resolve: {
+ alias: {
+ '@': fileURLToPath(new URL('./src', import.meta.url))
}
- }),
- Components({
- directoryAsNamespace: true,
- resolvers: [ElementPlusResolver()]
- }),
- createStyleImportPlugin({
- resolves: [ElementPlusResolve()]
- }),
- createSvgIconsPlugin({
- // 配置路劲在你的src里的svg存放文件
- iconDirs: [fileURLToPath(new URL('./src/assets/icons', import.meta.url))],
- symbolId: 'local-icon-[dir]-[name]'
- }),
- vueSetupExtend()
- ],
- resolve: {
- alias: {
- '@': fileURLToPath(new URL('./src', import.meta.url))
- }
- },
- css: {
- preprocessorOptions: {
- scss: {
- api: 'modern-compiler'
+ },
+ css: {
+ preprocessorOptions: {
+ scss: {
+ api: 'modern-compiler'
+ }
}
- }
- },
- optimizeDeps: {
- // 确保不重复包含这些依赖
- include: ['@wangeditor/editor-for-vue', 'vue-echarts', ...getElementPlusStylePaths()]
- },
- build: {
- rollupOptions: {
- output: {
- manualChunks(id) {
- if (id.includes('node_modules')) {
- return id.toString().split('node_modules/')[1].split('/')[0].toString()
+ },
+ optimizeDeps: {
+ // 确保不重复包含这些依赖
+ include: ['@wangeditor/editor-for-vue', 'vue-echarts', ...getElementPlusStylePaths()]
+ },
+ build: {
+ rollupOptions: {
+ output: {
+ manualChunks(id) {
+ if (id.includes('node_modules')) {
+ return id.toString().split('node_modules/')[1].split('/')[0].toString()
+ }
}
}
}
+ },
+ define: {
+ __VUE_PROD_DEVTOOLS__: false,
+ __VUE_OPTIONS_API__: true,
+ __VUE_PROD_HYDRATION__: true,
+ __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false
}
- },
- define: {
- __VUE_PROD_DEVTOOLS__: false,
- __VUE_OPTIONS_API__: true,
- __VUE_PROD_HYDRATION__: true,
- __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false
}
})