From 079c33e400f731384272540485a754b018267223 Mon Sep 17 00:00:00 2001 From: janetat Date: Fri, 26 Jun 2020 17:47:06 +0800 Subject: [PATCH] =?UTF-8?q?[chapter=5F6]=E4=BF=AE=E5=A4=8Dpost=5Fmessage?= =?UTF-8?q?=E7=9A=84if=E5=88=86=E6=94=AF=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chapter_6/main.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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(): -