Commit 725350d2 authored by wty's avatar wty

后端代码错误处理更新

parent e7e48c89
...@@ -33,7 +33,7 @@ router.get('/getUser', function (req, res, next) { ...@@ -33,7 +33,7 @@ router.get('/getUser', function (req, res, next) {
console.log(result) console.log(result)
const _result = result.slice() const _result = result.slice()
_result[0].follow = JSON.parse(_result[0].follow) _result[0]?.follow = JSON.parse(_result[0].follow)
...@@ -57,7 +57,7 @@ router.get('/login', (req, res) => { ...@@ -57,7 +57,7 @@ router.get('/login', (req, res) => {
}) })
throw err throw err
} }
if (result[0]?.uid) { if (!!result && result[0]?.uid) {
res.cookie('uid', result[0].uid) res.cookie('uid', result[0].uid)
res.send({ res.send({
success: true, success: true,
......
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