def POST(self): user_data = web.input() u = user_data.username p = user_data.password user = model.valid_user(u, p) if user and user.permission>10: session.user = user user.registertime = str(user.registertime) user.modifytime = str(user.modifytime) return web.seeother('/admin') return web.seeother('/admin/signin')
def POST(self): user_data = web.input() u = user_data.username p = user_data.password url = user_data.url user = model.valid_user(u, p) if user: session.user = user raise web.seeother(url) else: return env.get_template('signin.html').render({'showError':True,'url':url})
def POST(self): user_data = web.input() u = user_data.username p = user_data.password user = model.valid_user(u, p) if user: session.user = user user.registertime = str(user.registertime) user.modifytime = str(user.modifytime) return write_json({'result':True,'message':'login success','user':user}) return write_json({'result':False,'message':u'用户名或密码不正确'})