diff --git a/chapter_6/main.py b/chapter_6/main.py index 8f8d694..2f56f30 100644 --- a/chapter_6/main.py +++ b/chapter_6/main.py @@ -2,7 +2,7 @@ import datetime import hashlib import time -from your_code_here.RedisUtil import RedisUtil +from answer.RedisUtil import RedisUtil from urllib.parse import quote, unquote from flask import Flask, render_template, request, redirect @@ -61,7 +61,7 @@ def post_message(): return json.dumps({'success': False, 'reason': '昵称或聊天内容为空!'}, ensure_ascii=False) expire_time = redis_util.get_nick_msg_expire_time(nick, msg) - if not expire_time: + if expire_time < 1: message_info = {'msg': message['msg'], 'post_time': datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'), 'nick': message['nick']} @@ -83,4 +83,3 @@ def post_message(): -