Skip to content

Commit

Permalink
chore: 更新 prod API 配置
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles7c committed Apr 21, 2024
1 parent 2f78255 commit adf7a8b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 7 deletions.
7 changes: 2 additions & 5 deletions .env.production
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
# 环境变量 (命名必须以 VITE_ 开头)

# 是否在打包时启用 Mock
VITE_BUILD_MOCK = true

# 接口前缀
VITE_API_PREFIX = '/api'
VITE_BUILD_MOCK = false

# 接口地址
VITE_API_BASE_URL = 'http://localhost:18000'
VITE_API_BASE_URL = 'https://api.continew.top'

# 地址前缀
VITE_BASE = '/'
2 changes: 1 addition & 1 deletion .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
VITE_BUILD_MOCK = true

# 接口前缀
VITE_API_PREFIX = '/mock'
VITE_API_PREFIX = '/api'

# 接口地址
VITE_API_BASE_URL = 'http://localhost:8000'
Expand Down
2 changes: 1 addition & 1 deletion src/utils/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const StatusCodeMessage: ICodeMessage = {
}

const http: AxiosInstance = axios.create({
baseURL: import.meta.env.VITE_API_PREFIX,
baseURL: import.meta.env.VITE_API_PREFIX ?? import.meta.env.VITE_API_BASE_URL,
timeout: 30 * 1000
})

Expand Down

0 comments on commit adf7a8b

Please sign in to comment.