ref: 代码优化 & bugfix

This commit is contained in:
muwoo
2021-07-06 12:13:35 +08:00
parent 65572cbf64
commit bda7f0c091
4 changed files with 74 additions and 69 deletions

View File

@@ -74,7 +74,7 @@ const sysFile = {
},
getUserPlugins() {
try {
return store.get('user-plugins').devPlugins;
return store.get('user-plugins');
} catch (e) {
return []
}
@@ -97,15 +97,20 @@ function mergePlugins(plugins) {
})
]
return result.filter((item, i) => {
let targetIndex;
result.forEach((tg, j) => {
const target = [];
result.forEach((item, i) => {
let targetIndex = -1;
target.forEach((tg, j) => {
if (tg.tag === item.tag && tg.type === 'system') {
targetIndex = j
}
});
return i === targetIndex;
if (targetIndex === -1) {
target.push(item)
}
});
return target
}
function find(p, target = 'plugin.json') {