Commit 30ba49a4 authored by wty's avatar wty

后端代码错误处理更新1

parent 725350d2
......@@ -23,7 +23,7 @@ router.get('/getUser', function (req, res, next) {
// }
const SQL = 'SELECT * FROM `user` WHERE `user`.uid = ?'
Mysql.query(SQL, [uid], (err, result) => {
if (err) {
if (err || !result) {
res.send({
success: false,
err
......@@ -32,11 +32,7 @@ router.get('/getUser', function (req, res, next) {
}
console.log(result)
const _result = result.slice()
_result[0]?.follow = JSON.parse(_result[0].follow)
res.send({
success: true,
data: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment