diff --git a/.env.local-test b/.env.local-test index ffad5ecb6..5d9083e7f 100644 --- a/.env.local-test +++ b/.env.local-test @@ -1,5 +1,6 @@ # just a flag -NODE_ENV = 'local-test' +NODE_ENV = 'test' +VUE_APP_PRO = 'local-test' # base api # VUE_APP_BASE_API = 'https://test.joylink.club/jlcloud' diff --git a/package.json b/package.json index 5f860b670..4373cc9e3 100644 --- a/package.json +++ b/package.json @@ -6,11 +6,11 @@ "license": "MIT", "scripts": { "start": "vue-cli-service serve --open", - "dev": "node --max_old_space_size=4096 node_modules/@vue/cli-service/bin/vue-cli-service.js serve", + "dev": "node --max_old_space_size=4096 node_modules/@vue/cli-service/bin/vue-cli-service.js serve", "build": "vue-cli-service build --mode production", "test": "vue-cli-service build --mode staging", "local": "vue-cli-service build --mode", - "buildas": "node --max-old-space-size=4096 node_modules/@vue/cli-service/bin/vue-cli-service.js build --mode", + "buildas": "vue-cli-service build --mode", "preview": "node build/index.js --preview", "lint": "eslint --ext .js,.vue src", "test:unit": "jest --clearCache && vue-cli-service test:unit", diff --git a/src/utils/baseUrl.js b/src/utils/baseUrl.js index 30bf92c6f..b27593aec 100644 --- a/src/utils/baseUrl.js +++ b/src/utils/baseUrl.js @@ -40,16 +40,16 @@ export function handlerUrl(data) { VOICE_API = data && data.resourcesDomainName ? 'https://' + data.resourcesDomainName : 'https://joylink.club/oss/joylink'; UPLOAD_API = 'http://joylink.club/jlfile'; BASE_SITE = 'https://test.joylink.club/cbtc'; + } else if (process.env.NODE_ENV === 'test' && process.env.VUE_APP_PRO === 'local-test') { + BASE_API = 'https://192.168.3.233/rtss-server'; + VOICE_API = 'https://192.168.3.233/oss/joylink'; + UPLOAD_API = 'https://192.168.3.233'; + BASE_SITE = '/cbtc'; } else if (process.env.NODE_ENV === 'test') { BASE_API = data && data.domainName ? 'https://' + data.domainName : 'https://test.joylink.club/jlcloud'; VOICE_API = data && data.resourcesDomainName ? 'https://' + data.resourcesDomainName : 'https://joylink.club/oss/joylink'; UPLOAD_API = 'http://joylink.club/jlfile'; BASE_SITE = 'https://test.joylink.club/cbtc'; - } else if (process.env.NODE_ENV === 'local-test') { - BASE_API = 'https://192.168.3.233/rtss-server'; - VOICE_API = 'https://192.168.3.233/oss/joylink'; - UPLOAD_API = 'https://192.168.3.233'; - BASE_SITE = '/cbtc'; } else if (process.env.NODE_ENV === 'production' && process.env.VUE_APP_PRO === 'local') { BASE_API = 'http://160.20.60.15:9000'; VOICE_API = 'http://160.20.60.15/oss/joylink'; diff --git a/vue.config.js b/vue.config.js index c9d69dcba..9932b5eec 100644 --- a/vue.config.js +++ b/vue.config.js @@ -19,7 +19,6 @@ let outputDir = ''; outputDir = process.env.VUE_APP_PRO == 'local' || process.env.VUE_APP_PRO == 'ntyl' ? 'dist' : 'dist/cbtc'; })(); - // All configuration item explanations can be find in https://cli.vuejs.org/config/ module.exports = { /** @@ -33,7 +32,7 @@ module.exports = { outputDir: outputDir, assetsDir: 'static', // 相对于outputDir的静态资源(js、css、img、fonts)目录 lintOnSave: false, - productionSourceMap: false, + productionSourceMap: false, devServer: { port: port, host: '0.0.0.0', @@ -73,7 +72,7 @@ module.exports = { // }) // ); if (process.env.NODE_ENV != 'development') { - config.mode = 'production'; + config.mode = 'production'; Object.assign(config, { output:{ @@ -84,8 +83,8 @@ module.exports = { }); } else { // 为开发环境修改配置... - config.mode = 'development'; - config.name = name; + config.mode = 'development'; + config.name = name; } config.resolve = {