From 7052bb25c14365f76a744a6b54ad8bee60eed8d3 Mon Sep 17 00:00:00 2001 From: Agent Date: Sun, 29 Mar 2026 08:45:18 +0000 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E7=94=A8=E6=AD=A3=E5=BC=8F=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 2 +- .env.development | 6 +++--- .env.production | 2 +- vite.config.js | 2 -- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.drone.yml b/.drone.yml index 1cb1624..23f4bb6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -28,7 +28,7 @@ steps: - name: dev-build image: ccr.ccs.tencentyun.com/violin/node:22-bookworm commands: - - npm run build:h5 -- --mode development + - npm run build:h5 -- --mode production volumes: - name: node-cache path: /root/.npm diff --git a/.env.development b/.env.development index bf04d81..f14babb 100644 --- a/.env.development +++ b/.env.development @@ -1,3 +1,3 @@ -# 开发环境 -VITE_API_BASE_URL=http://localhost:8080/api/v1 -VITE_H5_BASE_URL=http://localhost:8080 \ No newline at end of file +# 环境配置 +VITE_API_BASE_URL=https://sales.violin-work.online/api/v1 +VITE_H5_BASE_URL=https://sales.violin-work.online \ No newline at end of file diff --git a/.env.production b/.env.production index 1d7e24a..f14babb 100644 --- a/.env.production +++ b/.env.production @@ -1,3 +1,3 @@ -# 生产环境 +# 环境配置 VITE_API_BASE_URL=https://sales.violin-work.online/api/v1 VITE_H5_BASE_URL=https://sales.violin-work.online \ No newline at end of file diff --git a/vite.config.js b/vite.config.js index 0b15f9a..64fac92 100644 --- a/vite.config.js +++ b/vite.config.js @@ -2,7 +2,6 @@ import { defineConfig, loadEnv } from 'vite' import uni from '@dcloudio/vite-plugin-uni' export default defineConfig(({ mode }) => { - // 加载当前环境的环境变量 const env = loadEnv(mode, process.cwd()) return { @@ -16,7 +15,6 @@ export default defineConfig(({ mode }) => { } }, define: { - // 注入环境变量到代码中 'import.meta.env.VITE_API_BASE_URL': JSON.stringify(env.VITE_API_BASE_URL || 'https://sales.violin-work.online/api/v1'), 'import.meta.env.VITE_H5_BASE_URL': JSON.stringify(env.VITE_H5_BASE_URL || 'https://sales.violin-work.online') }