def resetPwd(self): usr = str(self.username.text()) if len(usr) == 0: self.status.setText(u'登陆错误,用户名不能为空') else: u = User(usr) if u.id is None: self.status.setText(u'登陆错误,非注册用户') else: u.initPwd() resetPage = ResetPage(u) if resetPage.exec_(): self.show()
def login(self): usr = str(self.username.text()) if len(usr) == 0: self.status.setText(u'登陆错误,用户名不能为空') else: u = User(usr) if u.id is None: self.status.setText(u'登陆错误,非注册用户') else: if not u.checkPwd(str(self.pwd.text())): self.status.setText(u'登陆错误,密码错误') else: self.accept()