将配置文件名后缀由 .json5 改为 .json

pull/274/head
王良 2024-02-22 01:36:05 +08:00
parent 144527c705
commit 092696d2de
2 changed files with 5 additions and 5 deletions

View File

@ -17,19 +17,19 @@ function get () {
const getDefaultConfigBasePath = function () {
return get().server.setting.userBasePath
}
function _getRemoteSavePath (prefix = '') {
function _getRemoteSavePath (prefix = '', version = '') {
const dir = getDefaultConfigBasePath()
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir)
}
return path.join(dir, prefix + 'remote_config.json5')
return path.join(dir, prefix + 'remote_config.json' + version)
}
function _getConfigPath () {
const dir = getDefaultConfigBasePath()
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir)
}
return dir + '/config.json5'
return dir + '/config.json'
}
let timer
@ -64,7 +64,7 @@ const configApi = {
return
}
if (response && response.statusCode === 200) {
const originalRemoteSavePath = _getRemoteSavePath('original_')
const originalRemoteSavePath = _getRemoteSavePath('original_', '5')
fs.writeFileSync(originalRemoteSavePath, body)
log.info('保存原来的远程配置文件成功:', originalRemoteSavePath)

View File

@ -109,7 +109,7 @@ function _getSettingsPath () {
if (!fs.existsSync(dir)) {
fs.mkdirSync(dir)
}
return dir + '/setting.json5'
return dir + '/setting.json'
}
function invoke (api, param) {