-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
7 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,14 @@ | ||
let baseUrl= ""; //这里是一个默认的url,可以没有 | ||
let wsUrl = ""; | ||
switch (process.env.NODE_ENV) { | ||
case 'prv': | ||
baseUrl = "/api" //开发环境url | ||
wsUrl = "localhost:8088" | ||
break | ||
case 'pro': // 注意这里的名字要和步骤二中设置的环境名字对应起来 | ||
baseUrl = "/" //测试环境中的url | ||
wsUrl = window.location.host | ||
break | ||
} | ||
|
||
export default baseUrl; | ||
export {baseUrl,wsUrl}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters