From 7cd63cb27b8bdad59063bdb754a73d9d57db9e53 Mon Sep 17 00:00:00 2001
From: lizw-2015 <1183409807@qq.com>
Date: Thu, 19 Jun 2025 10:23:49 +0800
Subject: [PATCH 1/3] init
---
vite.config.ts | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/vite.config.ts b/vite.config.ts
index b71e1aa..6b871cb 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -2,7 +2,6 @@ import { fileURLToPath, URL } from 'node:url'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
-import typescript from 'rollup-plugin-typescript2'
// import vueJsx from '@vitejs/plugin-vue-jsx'
// import vueDevTools from 'vite-plugin-vue-devtools'
@@ -22,7 +21,11 @@ export default defineConfig({
port: 7791,
open: false,
proxy: {
- }
+ '^/api/.*': {
+ target: "http://127.0.0.1:8089",
+ changeOrigin: false,
+ },
+ },
},
optimizeDeps: {
include: [
From fa669b32095fc2de4bbc9ebdf17e2994129fc776 Mon Sep 17 00:00:00 2001
From: lizw-2015 <1183409807@qq.com>
Date: Thu, 19 Jun 2025 11:52:34 +0800
Subject: [PATCH 2/3] init
---
src/pages/JsDemo.vue | 47 +++++++++++++++++++++++++++++++++++++++++++++++
src/router/index.ts | 7 ++++++-
2 files changed, 53 insertions(+), 1 deletion(-)
create mode 100644 src/pages/JsDemo.vue
diff --git a/src/pages/JsDemo.vue b/src/pages/JsDemo.vue
new file mode 100644
index 0000000..fff3a71
--- /dev/null
+++ b/src/pages/JsDemo.vue
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+ {{ res }}
+
+
+
\ No newline at end of file
diff --git a/src/router/index.ts b/src/router/index.ts
index 6fb6583..fb5a3a2 100644
--- a/src/router/index.ts
+++ b/src/router/index.ts
@@ -33,7 +33,12 @@ const router = createRouter({
path: '/DataForm01',
name: 'DataForm01',
component: () => import('@/pages/DataForm01.vue')
- }
+ },
+ {
+ path: '/JsDemo',
+ name: 'JsDemo',
+ component: () => import('@/pages/JsDemo.vue')
+ },
]
})
From 4a1963c57fa3f05dc476f188147667d7a0e82d05 Mon Sep 17 00:00:00 2001
From: lizw-2015 <1183409807@qq.com>
Date: Thu, 19 Jun 2025 12:15:12 +0800
Subject: [PATCH 3/3] =?UTF-8?q?refactor(yvan-lcc):=E4=BC=98=E5=8C=96=20JsD?=
=?UTF-8?q?emo=20=E9=A1=B5=E9=9D=A2=E7=9A=84=E4=BB=A3=E7=A0=81=E6=89=A7?=
=?UTF-8?q?=E8=A1=8C=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 在代码模板中添加示例日志输出和日期对象- 优化 execute 函数的异步处理结构
- 调整代码格式,提高可读性
---
src/pages/JsDemo.vue | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
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 = "执行失败";
});
}