From c288c15f6be22feb5426c03dfaeff9c9badfbb49 Mon Sep 17 00:00:00 2001 From: lihui Date: Tue, 11 Nov 2025 14:27:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/__tests__/environment.test.ts | 41 ++ src/views/bankPaymentPage.vue | 127 ++++++ src/views/workspace/index_.vue | 911 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 1079 insertions(+) create mode 100644 src/__tests__/environment.test.ts create mode 100644 src/views/bankPaymentPage.vue create mode 100644 src/views/workspace/index_.vue diff --git a/src/__tests__/environment.test.ts b/src/__tests__/environment.test.ts new file mode 100644 index 0000000..d61e6ea --- /dev/null +++ b/src/__tests__/environment.test.ts @@ -0,0 +1,41 @@ +import { describe, it, expect, beforeEach, afterEach } from 'vitest'; + +describe('Environment Variables', () => { + const originalEnv = process.env; + + beforeEach(() => { + // 保存原始环境变量 + vi.resetModules(); + }); + + afterEach(() => { + // 恢复原始环境变量 + process.env = { ...originalEnv }; + }); + + it('should load development environment variables', async () => { + // 在实际项目中,您可能需要根据具体框架加载环境变量 + const env = import.meta.env; + + // 验证环境变量是否存在 + expect(env).toBeDefined(); + + // 注意:由于 .env.development 是空的,这里不会有很多变量可以测试 + // 但在实际项目中,您可以添加类似这样的测试: + // expect(env.VITE_API_BASE).toBe('expected_development_api_url'); + }); + + it('should have required environment variables', () => { + // 检查生产环境中必需的变量是否已定义 + const requiredVars = [ + // 'VITE_API_BASE', + // 'VITE_UPLOAD_URL' + ]; + + requiredVars.forEach((varName) => { + // 由于 .env.development 是空的,这些测试会失败 + // 请根据实际情况取消注释并修改 + // expect(import.meta.env[varName]).toBeDefined(); + }); + }); +}); \ No newline at end of file diff --git a/src/views/bankPaymentPage.vue b/src/views/bankPaymentPage.vue new file mode 100644 index 0000000..44f81ca --- /dev/null +++ b/src/views/bankPaymentPage.vue @@ -0,0 +1,127 @@ + + + + + diff --git a/src/views/workspace/index_.vue b/src/views/workspace/index_.vue new file mode 100644 index 0000000..190e23c --- /dev/null +++ b/src/views/workspace/index_.vue @@ -0,0 +1,911 @@ + + + + + \ No newline at end of file