Commit f0d3879c authored by antoor's avatar antoor

Add the encoders to prototype

添加编码器列表到prototype,这样就能在外部动态获取了
parent ffb25246
...@@ -22,11 +22,19 @@ class ASP extends Base { ...@@ -22,11 +22,19 @@ class ASP extends Base {
this.parseTemplate(`./asp/template/${_}`); this.parseTemplate(`./asp/template/${_}`);
}); });
// 解析编码器 // 解析编码器
[].map((_) => { this.encoders.map((_) => {
this.parseEncoder(`./asp/encoder/${_}`); this.parseEncoder(`./asp/encoder/${_}`);
}); });
} }
/**
* 获取编码器列表
* @return {array} 编码器列表
*/
get encoders() {
return [];
}
/** /**
* HTTP请求数据组合函数 * HTTP请求数据组合函数
* @param {Object} data 通过模板解析后的代码对象 * @param {Object} data 通过模板解析后的代码对象
......
...@@ -22,11 +22,19 @@ class ASPX extends Base { ...@@ -22,11 +22,19 @@ class ASPX extends Base {
this.parseTemplate(`./aspx/template/${_}`); this.parseTemplate(`./aspx/template/${_}`);
}); });
// 解析编码器 // 解析编码器
[].map((_) => { this.encoders.map((_) => {
this.parseEncoder(`./aspx/encoder/${_}`); this.parseEncoder(`./aspx/encoder/${_}`);
}); });
} }
/**
* 获取编码器列表
* @return {array} 编码器列表
*/
get encoders() {
return [];
}
/** /**
* HTTP请求数据组合函数 * HTTP请求数据组合函数
* @param {Object} data 通过模板解析后的代码对象 * @param {Object} data 通过模板解析后的代码对象
......
...@@ -19,11 +19,19 @@ class CUSTOM extends Base { ...@@ -19,11 +19,19 @@ class CUSTOM extends Base {
this.parseTemplate(`./custom/template/${_}`); this.parseTemplate(`./custom/template/${_}`);
}); });
// 解析编码器 // 解析编码器
[].map((_) => { this.encoders.map((_) => {
this.parseEncoder(`./custom/encoder/${_}`); this.parseEncoder(`./custom/encoder/${_}`);
}); });
} }
/**
* 获取编码器列表
* @return {array} 编码器列表
*/
get encoders() {
return [];
}
/** /**
* HTTP请求数据组合函数 * HTTP请求数据组合函数
* @param {Object} data 通过模板解析后的代码对象 * @param {Object} data 通过模板解析后的代码对象
......
...@@ -22,13 +22,20 @@ class PHP extends Base { ...@@ -22,13 +22,20 @@ class PHP extends Base {
this.parseTemplate(`./php/template/${_}`); this.parseTemplate(`./php/template/${_}`);
}); });
// 解析编码器 // 解析编码器
[ this.encoders.map((_) => {
'chr', 'base64'
].map((_) => {
this.parseEncoder(`./php/encoder/${_}`); this.parseEncoder(`./php/encoder/${_}`);
}); });
} }
/**
* 获取编码器列表
* ? 可以在antSword.core.php.prototype.encoders中获取此变量
* @return {array} 编码器列表
*/
get encoders() {
return ['chr', 'base64'];
}
/** /**
* HTTP请求数据组合函数 * HTTP请求数据组合函数
* @param {Object} data 通过模板解析后的代码对象 * @param {Object} data 通过模板解析后的代码对象
......
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