BUG修复,返回结构统一
This commit is contained in:
@@ -358,7 +358,13 @@ const runCode = async () => {
|
||||
})
|
||||
})
|
||||
|
||||
const result = await response.json()
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json()
|
||||
throw new Error(errorData.message || '代码执行失败')
|
||||
}
|
||||
|
||||
const data = await response.json()
|
||||
const result = data.result // 从统一响应格式中提取 result
|
||||
|
||||
let outputHtml = ''
|
||||
if (result.error) {
|
||||
|
||||
Reference in New Issue
Block a user