var filelist = JSON.parse(input.filelist?input.filelist:'[]');
//正则规则
var regex=/(?<=attname=).+(?=&e)/;
var filename="";
var filenamelist = [];
//文件名列表
//取值filenamelist[0] 第一个
for( var i in filelist){
filename = decodeURI(filelist[i].match(regex));
filenamelist.push(filename)
}
//获取到第一个附件的地址
var fileurl = filelist.length>0?filelist[0]:"";
//在线base64文件转文本
var fetch = require('node-fetch');
var filebase64 = await fetch(fileurl).then(r => r.buffer()).then(buf => buf.toString('base64'));
output={fileName:filenamelist[0],fileUrl:fileurl,fileBase64:filebase64}