Ejemplo n.º 1
0
 def POST(self):
     data = web.input()
     email = data.get('email')
     username = data.get('username')
     if email and username:
         if model.check_email(email, username): #验证邮箱和用户名是否匹配
             newpassword = model.update_password(username) #更新密码
             try:
                 web.sendmail('*****@*****.**', email, u'找回密码', u'您的新密码为%s' % newpassword)
             except Exception, e:
                 print e
             return render_without_layout.warning('发送成功', '/login')
         return render.forget('用户名邮箱不匹配')
Ejemplo n.º 2
0
 def GET(self):
     return render.forget(None)