refactor(GOV-010): 统一封装前端 Axios 请求

This commit is contained in:
2026-08-13 23:02:36 +08:00
parent 3a22fdeef3
commit 4105336cb2
10 changed files with 288 additions and 86 deletions
+4 -1
View File
@@ -5,7 +5,10 @@ import { describe, expect, it } from 'vitest';
import viteConfig from '../vite.config';
describe('Vite 本地 API 代理', () => {
it('通过同源 /api 转发到本地 NestJS,避免浏览器依赖跨域配置', () => {
it('统一解析源码别名并通过同源 /api 转发到本地 NestJS', () => {
expect(viteConfig.resolve?.alias).toMatchObject({
'@': expect.stringMatching(/web\/src$/),
});
expect(viteConfig.server?.proxy).toMatchObject({
'/api': {
target: 'http://127.0.0.1:3000',