vbenjs / vben-admin-thin-next

vue-vben-admin-2.0 mini template.vue3,vite,typescript
https://vvbin.cn/thin/next
MIT License
2.06k stars 853 forks source link

proxy无效 #21

Closed snowchenlei closed 3 years ago

snowchenlei commented 3 years ago

.env.development文件配置如下

# Whether to open mock
VITE_USE_MOCK = false

# public path
VITE_PUBLIC_PATH = /
VITE_PROXY=[["/c","http://121.196.122.107:8090"]]

VITE_GLOB_API_URL=/c

进行http请求地址为项目地址:localhost:3001,而不是这里配置的/c地址。 http请求如下:

getList = (input: GetIdentityUsersInput) =>
    defHttp.get<PagedResultDto<IdentityUserDto>>({
      url: '/api/identity/users',
      params: {
        filter: input.filter,
        sorting: input.sorting,
        skipCount: input.skipCount,
        maxResultCount: input.maxResultCount,
      },
      headers: {
        ignoreCancelToken: true,
      },
    });
anncwb commented 3 years ago

你的url应该改为/c/indentity