Add playground loading animation, password auth, and mobile layout support

Co-authored-by: qaiu <29825328+qaiu@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-07 05:20:06 +00:00
parent 9c121c03f2
commit 5fbbe5b240
6 changed files with 664 additions and 55 deletions

View File

@@ -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代码