Browse Source

同步更新likenum

master
hole-thu 5 years ago
parent
commit
a3fc72537e
  1. 7
      hole.py

7
hole.py

@ -197,6 +197,7 @@ def get_comment():
return { return {
'code': 0, 'code': 0,
'attention': check_attention(u.name, pid), 'attention': check_attention(u.name, pid),
'likenum': post.likenum,
'data': data 'data': data
} }
@ -255,7 +256,11 @@ def attention():
post.likenum += 1 - 2 * int(s == '0'); post.likenum += 1 - 2 * int(s == '0');
db.session.commit() db.session.commit()
return {'code': 0} return {
'code': 0,
'likenum': post.likenum,
'attention': (s=='1')
}
@app.route('/_api/v1/getattention') @app.route('/_api/v1/getattention')
def get_attention(): def get_attention():

Loading…
Cancel
Save