Skip to content

Commit

Permalink
feat(运行): 优化展示
Browse files Browse the repository at this point in the history
  • Loading branch information
gozeon committed Mar 27, 2024
1 parent 664d527 commit da019da
Show file tree
Hide file tree
Showing 8 changed files with 9,625 additions and 9,626 deletions.
11 changes: 5 additions & 6 deletions client/components/Postman/PostmanNew.js
Original file line number Diff line number Diff line change
Expand Up @@ -349,17 +349,16 @@ axios(options).then(res => pipe(res));
options.timeout = 800
try {
const result = await axios.post("/api/run/add", {options})
console.log("🚀 ~ Run ~ reqRealInterface= ~ result:", result)

this.setState({
resStatusCode: result.status,
resStatusText: result.statusText,
test_res_header: result.headers,
test_res_body: result.data,
resStatusCode: result.data.status,
resStatusText: result.data.statusText,
test_res_header: result.data.headers,
test_res_body: result.data.data,
loading: false
});
} catch(e) {
console.log("🚀 ~ Run ~ reqRealInterface= ~ e:", e)
alert(e.message)
this.setState({
loading: false
})
Expand Down
12 changes: 11 additions & 1 deletion server/controllers/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,17 @@ class RunController extends baseController {
const res = await axios(options)
ctx.body = _.pick(res, ["data", "status", "statusText", "headers"])
} catch (e) {
ctx.body = _.pick(e.response, ["data", "status", "statusText", "headers"])
if(e.response) {
ctx.body = _.pick(e.response, ["data", "status", "statusText", "headers"])
} else {
ctx.body = {
data: e.message,
status: e.errno,
statusText: e.code,
headers: e.config.headers
}
}

}
}

Expand Down
2 changes: 1 addition & 1 deletion static/prd/assets.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file removed static/prd/[email protected]
Binary file not shown.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit da019da

Please sign in to comment.