Skip to content

Commit

Permalink
fix: api url bug,I deeeeead
Browse files Browse the repository at this point in the history
  • Loading branch information
mlhiter committed Nov 7, 2024
1 parent 11fad1d commit bfebd11
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions extensions/ide/vscode/devbox/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ dist
node_modules
.vscode-test/
*.vsix

.env*.local
10 changes: 9 additions & 1 deletion extensions/ide/vscode/devbox/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,16 @@ const showStatus = (status: number) => {
return `${message}, please check the network or contact the administrator!`
}

const getBaseURL = () => {
const isDevelopment = process.env.NODE_ENV === 'development'
// TODO: 硬编码改为软编码
return isDevelopment
? 'http://127.0.0.1:3000'
: 'https://devbox.usw.sailos.io'
}

const request = axios.create({
baseURL: 'http://127.0.0.1:3000',
baseURL: getBaseURL(),
withCredentials: true,
timeout: 60000,
})
Expand Down

0 comments on commit bfebd11

Please sign in to comment.