Browse Source

session.permanent=True & 显示id

fudan
欧醚 4 years ago
parent
commit
2c592f38af
Signed by: OmmyZhang GPG Key ID: 757D312E7C9D13F7
3 changed files with 3 additions and 1 deletions
  1. +2
    -1
      app.py
  2. BIN
     
  3. +1
    -0
      templates/list.html

+ 2
- 1
app.py View File

@ -51,10 +51,11 @@ def send_img(path):
return send_from_directory('static/img', path) return send_from_directory('static/img', path)
@app.route('/ordinary/set_session') @app.route('/ordinary/set_session')
@limiter.limit("3 / hour; 1 / 5 minute")
@limiter.limit("2 / hour; 1 / 5 minute")
def set_session(): def set_session():
if 'uid' not in session: if 'uid' not in session:
session['uid'] = random.randint(0, 2000000000) session['uid'] = random.randint(0, 2000000000)
session.permanent = True
return redirect('.') return redirect('.')
@app.route('/ordinary/') @app.route('/ordinary/')

BIN
View File


+ 1
- 0
templates/list.html View File

@ -227,6 +227,7 @@
</div> </div>
{% for c in pagination.items %} {% for c in pagination.items %}
<div class="qbox"> <div class="qbox">
<small>#{{c.id}}</small>
<pre class="inner">{{c.content}}</pre> <pre class="inner">{{c.content}}</pre>
{% if showPrivate %} {% if showPrivate %}
<hr /> <hr />

Loading…
Cancel
Save