5 changed files with 50 additions and 0 deletions
@ -0,0 +1,8 @@ |
|||||
|
const ptconfig={ |
||||
|
//
|
||||
|
flag: 'udpub', |
||||
|
// request uri
|
||||
|
apiHost:'https://dfmg.dficoins.com/api/getkkline', |
||||
|
//
|
||||
|
coins:['PYTN','GQL'] |
||||
|
} |
||||
@ -0,0 +1,11 @@ |
|||||
|
// ** 本文件是config.js的默认数据 (请勿修改本文件中的内容)
|
||||
|
// ** 如需修改配置请移步到根目录的config.js文件
|
||||
|
export default { |
||||
|
//
|
||||
|
flag: 'kline', |
||||
|
// request uri
|
||||
|
apiHost:'https://xx.com/api/getkkline', |
||||
|
//
|
||||
|
coins:['AAA','BBB'] |
||||
|
} |
||||
|
|
||||
@ -0,0 +1,24 @@ |
|||||
|
import defaultconfig from "./defaultconfig.js"; |
||||
|
|
||||
|
const config = window.ptconfig |
||||
|
//
|
||||
|
const allconfig = Object.assign({},defaultconfig,config) |
||||
|
|
||||
|
// 配置文件工具类
|
||||
|
export default { |
||||
|
all(){ |
||||
|
return config; |
||||
|
}, |
||||
|
//获取指定配置
|
||||
|
get(key,def=undefined){ |
||||
|
console.log(allconfig) |
||||
|
console.log(key) |
||||
|
if(allconfig.hasOwnProperty(key)){ |
||||
|
return allconfig[key] |
||||
|
}else{ |
||||
|
console.error('The key:\"'+key+'\" unseted in config') |
||||
|
return def |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue