From 5fbbe5b240551b622e36adf67c88df58f27f90e5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 7 Dec 2025 05:20:06 +0000 Subject: [PATCH] Add playground loading animation, password auth, and mobile layout support Co-authored-by: qaiu <29825328+qaiu@users.noreply.github.com> --- web-front/src/utils/playgroundApi.js | 27 + web-front/src/views/Playground.vue | 472 ++++++++++++++++-- .../src/main/java/cn/qaiu/lz/AppMain.java | 4 + .../qaiu/lz/web/config/PlaygroundConfig.java | 73 +++ .../qaiu/lz/web/controller/PlaygroundApi.java | 136 ++++- web-service/src/main/resources/app-dev.yml | 7 + 6 files changed, 664 insertions(+), 55 deletions(-) create mode 100644 web-service/src/main/java/cn/qaiu/lz/web/config/PlaygroundConfig.java diff --git a/web-front/src/utils/playgroundApi.js b/web-front/src/utils/playgroundApi.js index d65854d..869d0bb 100644 --- a/web-front/src/utils/playgroundApi.js +++ b/web-front/src/utils/playgroundApi.js @@ -4,6 +4,33 @@ import axios from 'axios'; * 演练场API服务 */ export const playgroundApi = { + /** + * 获取Playground状态(是否需要认证) + * @returns {Promise} 状态信息 + */ + async getStatus() { + try { + const response = await axios.get('/v2/playground/status'); + return response.data; + } catch (error) { + throw new Error(error.response?.data?.error || error.message || '获取状态失败'); + } + }, + + /** + * Playground登录 + * @param {string} password - 访问密码 + * @returns {Promise} 登录结果 + */ + async login(password) { + try { + const response = await axios.post('/v2/playground/login', { password }); + return response.data; + } catch (error) { + throw new Error(error.response?.data?.error || error.message || '登录失败'); + } + }, + /** * 测试执行JavaScript代码 * @param {string} jsCode - JavaScript代码 diff --git a/web-front/src/views/Playground.vue b/web-front/src/views/Playground.vue index cf5c31e..22ed46d 100644 --- a/web-front/src/views/Playground.vue +++ b/web-front/src/views/Playground.vue @@ -1,6 +1,58 @@