fix: login state lost #20

This commit is contained in:
chenghx 2018-08-20 16:10:46 +08:00
parent 3053544b59
commit e3c5f57366

View File

@ -16,6 +16,15 @@ export default {
_rev: doc._rev,
user: user
})
}).catch(e => {
if (e.status === 404) {
db.put({
_id: 'currUser',
user: user
})
} else {
throw e
}
})
}
}