Skip to content

Commit

Permalink
fix: vite env
Browse files Browse the repository at this point in the history
  • Loading branch information
xjh22222228 committed Jan 20, 2022
1 parent 92be3eb commit 0d97ea4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
VITE_HTTP_BASE=http://localhost:7003/api
VITE_HTTP_BASE=http://localhost:7003/api
VITE_DEV=true
3 changes: 2 additions & 1 deletion .env.prod
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
VITE_HTTP_BASE=https://work-api.xiejiahe.com/api
VITE_HTTP_BASE=https://work-api.xiejiahe.com/api
VITE_DEV=false
5 changes: 2 additions & 3 deletions src/config/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

const { PROD, VITE_HTTP_BASE, DEV } = import.meta.env
const { VITE_HTTP_BASE, VITE_DEV } = import.meta.env
const PROD = VITE_DEV === 'true'
const isDevelopment = !PROD

console.log(PROD, DEV)

const CONFIG = {
isProduction: PROD,
isDevelopment,
Expand Down
1 change: 0 additions & 1 deletion src/views/login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ export default function () {
const goGithubAuth = () => {
setLoading(true)
const url = `https://github.com/login/oauth/authorize?response_type=code&redirect_uri=${config.github.callbackURL}&client_id=${config.github.clientId}&scope=repo%20repo_deployment%20read:user`
console.log(url)
window.location.replace(url)
}

Expand Down

1 comment on commit 0d97ea4

@vercel
Copy link

@vercel vercel bot commented on 0d97ea4 Jan 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.