def insert(self, userName, password): ''' 插入数据 ''' value = 0; if DBUserInfo.select(userName) == None: value = DBUserInfo.insert(userName, password) return value
def insert(self, userName, password): ''' 插入数据 ''' value = 0 if DBUserInfo.select(userName) == None: value = DBUserInfo.insert(userName, password) return value
def login(self, userName, password): """ 用户登录 returns: true:登录成功 false:登录失败 """ if DBUserInfo.login(userName, password): Logger.info("用户验证成功") userInfo = UserInfo(userName, 0); from webapp.Common import Common Common.session.userInfo = userInfo # 初始化菜单数据 from MenuManagement import MenuManagement Common.session.menu = MenuManagement(userName) return True else: Logger.info("用户验证失败") return False;
def select(self, userName): ''' 查找指定用户 ''' value = DBUserInfo.select(userName) return value
def selectAll(self, userName): ''' 查找用户 ''' value = DBUserInfo.selectAll(userName) return value