Commit ba3e29a4 authored by Medicean's avatar Medicean

(Enhancement: Plugin) 插件支持的脚本类型支持通配符 *

parent e06ab07f
...@@ -177,7 +177,8 @@ class ContextMenu { ...@@ -177,7 +177,8 @@ class ContextMenu {
// 判断脚本是否支持,不支持则禁止 // 判断脚本是否支持,不支持则禁止
if (p['info']['scripts'] && p['info']['scripts'].length > 0) { if (p['info']['scripts'] && p['info']['scripts'].length > 0) {
infos.map((_info) => { infos.map((_info) => {
if (p['info']['scripts'].indexOf(_info['type']) === -1) { console.log(p['info']['scripts'])
if (p['info']['scripts'].indexOf("*") === -1 && p['info']['scripts'].indexOf(_info['type']) === -1) {
// 如果检测到不支持的脚本,则禁止 // 如果检测到不支持的脚本,则禁止
ret = true; ret = true;
} }
...@@ -185,7 +186,7 @@ class ContextMenu { ...@@ -185,7 +186,7 @@ class ContextMenu {
} }
// 判断是否支持多目标执行 // 判断是否支持多目标执行
return ret || !p['info']['multiple']; return ret || !p['info']['multiple'];
})() : info && (p['info']['scripts'] || []).indexOf(info['type']) === -1, })() : info && (p['info']['scripts'] || []).indexOf("*") === -1 && (p['info']['scripts'] || []).indexOf(info['type']) === -1,
action: ((plug) => () => { action: ((plug) => () => {
// 如果没有加载到内存,则加载 // 如果没有加载到内存,则加载
if (!antSword['plugins'][plug['_id']]['module']) { if (!antSword['plugins'][plug['_id']]['module']) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment