Commit 22ca72a7 authored by Medicean's avatar Medicean

(Enhance:Core)解码器新增 ext 参数, 用于获取 shell 配置和rsa私钥

parent 67961ca6
......@@ -14,6 +14,8 @@
> 与之相关的一个 Demo, PHP aes-256-cfb (zeroPadding) 编码器
> https://github.com/AntSwordProject/AwesomeEncoder/blob/master/php/aes_256_cfb_zero_padding.js
* 解码器新增 ext 参数, 用于获取 shell 配置和rsa私钥
### 数据管理
* 「添加数据」时自动载入「默认设置」中「数据管理」全局配置内容
......
{
"name": "antsword",
"version": "2.1.1.5",
"version": "2.1.1.6",
"description": "中国蚁剑是一款跨平台的开源网站管理工具",
"main": "app.js",
"dependencies": {
......
......@@ -247,6 +247,10 @@ class Base {
*/
request(code, chunkCallBack) {
const opt = this.complete(code);
let ext = {
opts: this.__opts__,
rsa: this.rsaEncrypt()
}
return new Promise((res, rej) => {
// 随机ID(用于监听数据来源)
const hash = (String(+new Date) + String(Math.random())).substr(10, 10).replace('.', '_');
......@@ -256,8 +260,8 @@ class Base {
.once(`request-${hash}`, (event, ret) => {
return res({
'encoding': ret['encoding'] || "",
'text': this.__decoder__[this.__opts__['decoder']||'default'].decode_str(ret['text']),
'buff': this.__decoder__[this.__opts__['decoder']||'default'].decode_buff(ret['buff'])
'text': this.__decoder__[this.__opts__['decoder']||'default'].decode_str(ret['text'], ext),
'buff': this.__decoder__[this.__opts__['decoder']||'default'].decode_buff(ret['buff'], ext)
});
})
// HTTP请求返回字节流
......
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