mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2026-01-12 01:14:13 +00:00
Fix playground bugs and remove TypeScript compiler
- Fix BUG1: JavaScript timeout with proper thread interruption using ScheduledExecutorService - Fix BUG2: Add URL regex validation before execution in playground test API - Fix BUG3: Register published parsers to CustomParserRegistry on save/update/delete - Remove TypeScript compiler functionality (tsCompiler.js, dependencies, UI) - Add password authentication for playground access - Add mobile responsive layout support - Load playground parsers on application startup
This commit is contained in:
@@ -170,54 +170,4 @@ export const playgroundApi = {
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 保存TypeScript代码及其编译结果
|
||||
*/
|
||||
async saveTypeScriptCode(parserId, tsCode, es5Code, compileErrors, compilerVersion, compileOptions, isValid) {
|
||||
try {
|
||||
const response = await axios.post('/v2/playground/typescript', {
|
||||
parserId,
|
||||
tsCode,
|
||||
es5Code,
|
||||
compileErrors,
|
||||
compilerVersion,
|
||||
compileOptions,
|
||||
isValid
|
||||
});
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw new Error(error.response?.data?.error || error.response?.data?.msg || error.message || '保存TypeScript代码失败');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 根据parserId获取TypeScript代码
|
||||
*/
|
||||
async getTypeScriptCode(parserId) {
|
||||
try {
|
||||
const response = await axios.get(`/v2/playground/typescript/${parserId}`);
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw new Error(error.response?.data?.error || error.response?.data?.msg || error.message || '获取TypeScript代码失败');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 更新TypeScript代码
|
||||
*/
|
||||
async updateTypeScriptCode(parserId, tsCode, es5Code, compileErrors, compilerVersion, compileOptions, isValid) {
|
||||
try {
|
||||
const response = await axios.put(`/v2/playground/typescript/${parserId}`, {
|
||||
tsCode,
|
||||
es5Code,
|
||||
compileErrors,
|
||||
compilerVersion,
|
||||
compileOptions,
|
||||
isValid
|
||||
});
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
throw new Error(error.response?.data?.error || error.response?.data?.msg || error.message || '更新TypeScript代码失败');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user