提交 dbc6232e 编写于 作者: 杨广俊's avatar 杨广俊

环境变量文件 截流优化

上级 c614dc57
...@@ -21,7 +21,7 @@ module.exports = { ...@@ -21,7 +21,7 @@ module.exports = {
dev: { dev: {
env: { env: {
NODE_ENV: '"development"', NODE_ENV: '"development"',
OWNER_ENV: '"' + process.env.OWNER_ENV + '"' BUILD_ENV: '"' + process.env.BUILD_ENV + '"'
}, },
port: 8009, port: 8009,
assetsSubDirectory: 'static', assetsSubDirectory: 'static',
......
...@@ -6,13 +6,13 @@ ...@@ -6,13 +6,13 @@
"private": true, "private": true,
"license": "GPL", "license": "GPL",
"scripts": { "scripts": {
"dev": "cross-env OWNER_ENV=development node build/dev-server.js", "dev": "cross-env BUILD_ENV=development node build/dev-server.js",
"local": "cross-env OWNER_ENV=development node build/dev-server.js", "local": "cross-env BUILD_ENV=development node build/dev-server.js",
"build": "node build/build.js", "build": "node build/build.js",
"build:dev": "cross-env OWNER_ENV=dev node build/build.js", "build:dev": "cross-env BUILD_ENV=dev node build/build.js",
"build:test": "cross-env OWNER_ENV=test node build/build.js", "build:test": "cross-env BUILD_ENV=test node build/build.js",
"build:uat": "cross-env OWNER_ENV=uat node build/build.js", "build:uat": "cross-env BUILD_ENV=uat node build/build.js",
"build:pro": "cross-env OWNER_ENV=pro node build/build.js" "build:pro": "cross-env BUILD_ENV=pro node build/build.js"
}, },
"dependencies": { "dependencies": {
"@babel/polyfill": "^7.2.5", "@babel/polyfill": "^7.2.5",
......
...@@ -586,7 +586,7 @@ export default { ...@@ -586,7 +586,7 @@ export default {
// top: px2rem(122px); // top: px2rem(122px);
// z-index: 201; // z-index: 201;
width: px2rem(375px); width: px2rem(375px);
height: 82%; height: 81%;
overflow: auto; overflow: auto;
font-size: px2rem(14px); font-size: px2rem(14px);
color: #666666; color: #666666;
......
/**
* 环境变量配置文件
*/
export const envConfig = {
development: {
// baseUrl: 'https://dev-sc.yunqueyi.com/',
// // baseUrl: 'http://10.177.15.180:10202/',
// // baseUrl: 'http://192.168.140.14:10201/',
// apiUrl: 'https://dev-api.yunqueyi.com/',
// webPageUrl: 'https://dev-phome.yunqueyi.com/',
baseUrl: 'https://test1-sc.yunqueyi.com/',
apiUrl: 'https://test1-api.yunqueyi.com/',
webPageUrl: 'https://test1-phome.yunqueyi.com/'
},
dev: {
baseUrl: 'https://dev-sc.yunqueyi.com/',
apiUrl: 'https://dev-api.yunqueyi.com/',
webPageUrl: 'https://dev-phome.yunqueyi.com/'
},
test: {
baseUrl: 'https://test1-sc.yunqueyi.com/',
apiUrl: 'https://test1-api.yunqueyi.com/',
webPageUrl: 'https://test1-phome.yunqueyi.com/'
},
uat: {
baseUrl: 'https://uat-sc.yunqueyi.com/',
apiUrl: 'https://uat-api.yunqueyi.com/',
webPageUrl: 'https://uat-phome.yunqueyi.com/'
},
pro: {
baseUrl: 'https://sc.yunqueyi.com/',
apiUrl: 'https://api.yunqueyi.com/',
webPageUrl: 'https://phome.yunqueyi.com/'
}
}
/** /**
* Created by Anndy Yang on 18/09/18. * Created by Anndy Yang on 18/09/18.
*/ */
import { envConfig } from '@/utils/envConfig'
export function setEventByModuleCode(itemData){ export function setEventByModuleCode(itemData){
let modeCode = itemData.appModuleInfo.code || ''; let modeCode = itemData.appModuleInfo.code || '';
...@@ -77,55 +78,21 @@ export function sortParmData(originData, orderCol, index) { ...@@ -77,55 +78,21 @@ export function sortParmData(originData, orderCol, index) {
// 获取SC服务器域名地址 // 获取SC服务器域名地址
export function getBaseUrl(url) { export function getBaseUrl(url) {
return getConfigByEvtType('baseUrl') + url return getConfigByEnvType('baseUrl') + url
} }
// 获取API服务器域名地址 // 获取API服务器域名地址
export function getApiUrl(url) { export function getApiUrl(url) {
return getConfigByEvtType('apiUrl') + url return getConfigByEnvType('apiUrl') + url
} }
// 获取WEB部署服务器域名地址 // 获取WEB部署服务器域名地址
export function getWebPageUrl(url) { export function getWebPageUrl(url) {
return getConfigByEvtType('webPageUrl') + url return getConfigByEnvType('webPageUrl') + url
} }
// 根据不同环境,生成URL // 根据不同环境,生成URL
function getConfigByEvtType(url) { function getConfigByEnvType(url) {
return evtConfig[process.env.OWNER_ENV][url] return envConfig[process.env.BUILD_ENV][url]
}
const evtConfig = {
development: {
// baseUrl: 'https://dev-sc.yunqueyi.com/',
// // baseUrl: 'http://10.177.15.180:10202/',
// // baseUrl: 'http://192.168.140.14:10201/',
// apiUrl: 'https://dev-api.yunqueyi.com/',
// webPageUrl: 'https://dev-phome.yunqueyi.com/',
baseUrl: 'https://test1-sc.yunqueyi.com/',
apiUrl: 'https://test1-api.yunqueyi.com/',
webPageUrl: 'https://test1-phome.yunqueyi.com/'
},
dev: {
baseUrl: 'https://dev-sc.yunqueyi.com/',
apiUrl: 'https://dev-api.yunqueyi.com/',
webPageUrl: 'https://dev-phome.yunqueyi.com/'
},
test: {
baseUrl: 'https://test1-sc.yunqueyi.com/',
apiUrl: 'https://test1-api.yunqueyi.com/',
webPageUrl: 'https://test1-phome.yunqueyi.com/'
},
uat: {
baseUrl: 'https://uat-sc.yunqueyi.com/',
apiUrl: 'https://uat-api.yunqueyi.com/',
webPageUrl: 'https://uat-phome.yunqueyi.com/'
},
pro: {
baseUrl: 'https://sc.yunqueyi.com/',
apiUrl: 'https://api.yunqueyi.com/',
webPageUrl: 'https://phome.yunqueyi.com/'
}
} }
...@@ -255,14 +255,14 @@ export default { ...@@ -255,14 +255,14 @@ export default {
// let fivesTop = document.querySelector('#fiveBoxMenu').offsetTop; // let fivesTop = document.querySelector('#fiveBoxMenu').offsetTop;
}, },
scrollFun(){ // 响应滚动事件,截流处理
scrollFun() {
let isBusy = false let isBusy = false
if (!isBusy) { if (!isBusy) {
isBusy = true isBusy = true
setTimeout(() => { setTimeout(() => {
let scrollTop = document.body.scrollTop || document.documentElement.scrollTop let scrollTop = document.body.scrollTop || document.documentElement.scrollTop
if(scrollTop > 20){ if(scrollTop > 20){
console.log(scrollTop);
this.searchFix = true; this.searchFix = true;
}else{ }else{
this.searchFix = false; this.searchFix = false;
...@@ -270,12 +270,6 @@ export default { ...@@ -270,12 +270,6 @@ export default {
isBusy = false isBusy = false
}, 100) }, 100)
} }
// let scrollTop = document.body.scrollTop || document.documentElement.scrollTop
// if(scrollTop > 20){
// this.searchFix = true;
// }else{
// this.searchFix = false;
// }
}, },
// 获取轮播图数据 // 获取轮播图数据
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册