diff --git a/src/pages/JsDemo.vue b/src/pages/JsDemo.vue index fff3a71..3d0cb9c 100644 --- a/src/pages/JsDemo.vue +++ b/src/pages/JsDemo.vue @@ -5,11 +5,14 @@ import YvSrcEditor from "../components/YvSrcEditor.vue" const code = ref(` +log.info("测试打印日志,通过服务端控制台查看") const a = 111, b= 555; const sum = (a + b); print(a + "+" + b + " = " + sum); return { + sum, + date: new Date(), msg: "测试JS脚本", } `); @@ -19,9 +22,9 @@ const res = ref(""); function execute() { Request.request.post("/api/workbench/JsDemo@runJs", { jsCode: code.value, - }).then(data=> { + }).then(data => { res.value = JSON.stringify(data, null, 4); - }).catch(()=> { + }).catch(() => { res.value = "执行失败"; }); }