// 输入输出参数格式化 input = INPUT; output = {}; try { input = decodeURIComponent(input); } catch (e) { } try { input = base64.decode(input); } catch (e) { } try { input = JSON.parse(input); input = JSON.parse(input); // 解析可能存在的重复编码 } catch (e) { } // 主执行阶段 try { // 示例处理过程,返回输入信息 output.sampledata = { input: input, }; } catch (e) { // 错误信息输出处理,抛出 ok 表示正常结束 if (e != "ok") { if (typeof (e) == "object") { output.error = e; } else if (typeof (e) == "string") { output.error = "错误:" + e; } else { output.error = JSON.stringify(e); } log.error(output.error); STATUS = "error"; } } // 返回输出信息 OUTPUT = output;