Exemplo n.º 1
0
 def handle(self):
     userinfo_bytes = self.request.recv(1024)
     userinfo = json.loads(userinfo_bytes.decode("utf-8"))
     print(userinfo)
     if auth(**userinfo):
         self.request.send('连接成功'.encode("utf-8"))
     else:
         self.request.send('连接失败'.encode("utf-8"))
Exemplo n.º 2
0
Arquivo: app.py Projeto: Resert/python
def post_login():
  if 'login' in bottle.request.POST and 'password' in bottle.request.POST:
    login = bottle.request.POST['login']
    password = bottle.request.POST['password']
    if user.auth(login,password):
      save_session(login)
      bottle.redirect('/edit')
  return bottle.redirect('/')
Exemplo n.º 3
0
def login():
    if request.method == 'POST':
        username = request.form['username'].strip()
        password = request.form['password'].strip()
        if user.auth(username, password):
            session['username'] = request.form['username']
            return redirect(url_for('index'))

    return render_template('login.html', page="login")
Exemplo n.º 4
0
def login():
    if request.method == 'POST':
        username = request.form['username'].strip()
        password = request.form['password'].strip()
        if user.auth(username, password):
            session['username'] = request.form['username']
            return redirect(url_for('index'))

    return render_template('login.html', page="login")