perf: 远程配下载与合并

pull/192/head
xiaojunnuo 2021-08-27 17:17:06 +08:00
parent 498c7cbec2
commit 296c5c15f0
3 changed files with 11 additions and 7 deletions

View File

@ -122,12 +122,17 @@ const configApi = {
if (get().app.remoteConfig.enabled !== true) { if (get().app.remoteConfig.enabled !== true) {
return {} return {}
} }
const path = _getRemoteSavePath() try {
if (fs.existsSync()) { const path = _getRemoteSavePath()
const file = fs.readFileSync(path)
log.info('读取合并远程配置文件:', path) log.info('读取合并远程配置文件:', path)
return JSON5.parse(file.toString()) if (fs.existsSync(path)) {
const file = fs.readFileSync(path)
return JSON5.parse(file.toString())
}
} catch (e) {
log.info('远程配置读取有误', e)
} }
return {} return {}
}, },
/** /**

View File

@ -76,8 +76,7 @@ module.exports = {
}, },
'github.githubassets.com': { 'github.githubassets.com': {
'.*': { '.*': {
proxy: 'assets.fastgit.org', proxy: 'assets.fastgit.org'
sni11: 'baidu.com'
} }
}, },
'customer-stories-feed.github.com': { 'customer-stories-feed.github.com': {

View File

@ -4,7 +4,7 @@
'github.githubassets.com': { 'github.githubassets.com': {
'.*': { '.*': {
proxy: 'assets.fastgit.org', proxy: 'assets.fastgit.org',
sni11: 'baidu.com' sni: null
} }
} }
}, },