Authored by Aiden Xu

资讯详情

... ... @@ -26,7 +26,7 @@ const component = {
const id = req.params[0];
let params = {
uid: req.user.uid || 8050378,
uid: req.user.uid || 0,
article_id: id,
client_type: 'h5'
};
... ... @@ -66,10 +66,9 @@ const component = {
favorite(req, res, next) {
const params = {
article_id: req.params[0],
uid: req.user.uid || 8050378
uid: req.user.uid || 0
};
/*
if (!req.user.id) {
res.json({
code: 403
... ... @@ -77,7 +76,7 @@ const component = {
return;
}
*/
model.favorite(params, 'true' === req.query.flag).then(result => {
res.json(result);
}).catch(next);
... ... @@ -93,7 +92,7 @@ const component = {
misc(req, res, next) {
const params = {
article_id: req.params[0],
uid: req.user.uid || 8050378,
uid: req.user.uid || 0,
udid: req.sessionID
};
... ...
... ... @@ -27,6 +27,7 @@
</style>
<script>
const yoho = require('yoho');
const tip = require('common/tip');
require('common/vue-filter');
... ... @@ -75,6 +76,13 @@
if (result.code === 200) {
// TODO:
} if (result.code === 403) {
// 未登陆
yoho.goLogin('', function() {
this.toggleFavorite();
}, function() {
tip('登陆失败');
});
}
if (misc.code === 200) {
... ...