Revert "远程配置排序在默认配置之前。"

This reverts commit ae20539e87.
pull/303/head
王良 2024-04-21 22:33:25 +08:00
parent ae20539e87
commit 5c424f9589
1 changed files with 1 additions and 7 deletions

View File

@ -206,17 +206,11 @@ const configApi = {
return configApi.load(newConfig) return configApi.load(newConfig)
}, },
load (newConfig) { load (newConfig) {
const remoteConfig = configApi.readRemoteConfig()
// 以用户配置作为基准配置,是为了保证用户配置的顺序在前 // 以用户配置作为基准配置,是为了保证用户配置的顺序在前
const merged = newConfig != null ? lodash.cloneDeep(newConfig) : {} const merged = newConfig != null ? lodash.cloneDeep(newConfig) : {}
// 先合并一次远程配置是为了让远程配置排序在默认配置之前,用户配置之后
if (remoteConfig != null) {
mergeApi.doMerge(merged, remoteConfig)
}
mergeApi.doMerge(merged, defConfig) // 合并默认配置 mergeApi.doMerge(merged, defConfig) // 合并默认配置
mergeApi.doMerge(merged, remoteConfig) // 合并远程配置 mergeApi.doMerge(merged, configApi.readRemoteConfig()) // 合并远程配置
if (newConfig != null) { if (newConfig != null) {
mergeApi.doMerge(merged, newConfig) // 再合并一次用户配置,使用户配置重新生效 mergeApi.doMerge(merged, newConfig) // 再合并一次用户配置,使用户配置重新生效
} }