refactor(GOV-010): 统一封装前端 Axios 请求
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user