def POST(self): i = web.input() username = i.username password = i.password userid = corp.checkuser(username,password) if userid: corpdes = corp.getcorp(userid) corpname = corpdes[0]['SNAME'] web.ctx.session.userid = userid web.ctx.session.username = username web.ctx.session.usercname = corpname web.ctx.session.permission = corpdes[0]['PERMISSION'] raise web.seeother('/') else: web.ctx.session.userid = 0 return render.login('用户名或密码错误,请重新登录!')
def GET(self,id): corps = corp.getcorp(id) return render.users_edit(corps[0])