Skip to content

Commit

Permalink
fix: 修复 axios baseURL 配置,解决构建后 baseURL 不生效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
hooray committed Mar 6, 2023
1 parent 86d05f4 commit 4ba5ea2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const toLogin = () => {
}

const api = axios.create({
baseURL: import.meta.env.DEV && (import.meta.env.VITE_OPEN_PROXY === 'true' ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL),
baseURL: (import.meta.env.DEV && import.meta.env.VITE_OPEN_PROXY === 'true') ? '/proxy/' : import.meta.env.VITE_APP_API_BASEURL,
timeout: 1000 * 60,
responseType: 'json',
})
Expand Down

0 comments on commit 4ba5ea2

Please sign in to comment.