使用try-catch处理访问数据库错误 //用async await处理promise回调 export async function getAllUser(req,res){ try{ //db.query()返回的是一个promise对象,将第一个数值解构出来[rows] const [rows] = await db.query('select id,user,password from stu