|
@@ -1,3 +1,12 @@
|
|
|
+// 本地开发环境
|
|
|
+const local = {
|
|
|
+ oss: 'https://openapi.dev.bozedu.net',
|
|
|
+ api: 'https://hdpb.dev.bozedu.net/',
|
|
|
+ login: 'https://qqyxt.dev.bozedu.net/app/activityRating/home/login.html',
|
|
|
+ origin: window.location.origin,
|
|
|
+}
|
|
|
+
|
|
|
+// 测试服环境
|
|
|
const development = {
|
|
|
oss: 'https://openapi.dev.bozedu.net',
|
|
|
api: 'https://hdpb.dev.bozedu.net/',
|
|
@@ -5,6 +14,7 @@ const development = {
|
|
|
origin: window.location.origin + '/app/activityRating/manage/',
|
|
|
}
|
|
|
|
|
|
+// 正式服环境
|
|
|
const production = {
|
|
|
oss: 'https://openapi.bozedu.net',
|
|
|
api: 'https://hdpb.bozedu.net/',
|
|
@@ -12,11 +22,13 @@ const production = {
|
|
|
origin: window.location.origin + '/app/activityRating/manage/',
|
|
|
}
|
|
|
|
|
|
-function isDev() {
|
|
|
- // console.log('isDev')
|
|
|
- return (
|
|
|
- window.location.host.includes('dev') ||
|
|
|
- window.location.host.includes('localhost')
|
|
|
- )
|
|
|
+function isWhich() {
|
|
|
+ if (window.location.host.includes('localhost')) {
|
|
|
+ return local
|
|
|
+ } else if (window.location.host.includes('dev')) {
|
|
|
+ return development
|
|
|
+ } else {
|
|
|
+ return production
|
|
|
+ }
|
|
|
}
|
|
|
-window.globalVariables = isDev() ? development : production
|
|
|
+window.globalVariables = isWhich()
|