is returned to the front-end status code, is the front-end status code given according to the judgment of the back-end itself? Is there still some official way? For beginners to learn the back end, please let me know
async selectData(ctx) {
let data = ctx.request.body
let userAddParams = [data.oid,data.uid,data.name,data.buytime];
if(Object.keys(data).length > 0) {
try {
await query(insert, userAddParams);
ctx.response.body = {
status: 200,
description: "ok",
result: data
}
} catch(err) {
ctx.response.body = {
status: 404
}
}
}
}