Python添加用户判断

    def saveRegistData(self):
        """用户注册"""
        print("保存数据")
        saveDataPath=os.path.join(os.getcwd(),"config","accout.json")
        accountType=self.accoutTypeComboBox.currentText() # 账户类型
        account=self.account_le.text().strip() # 账户名称
        accountName=self.accountName_le.text() # 账户姓名
        accountPhone=self.accountPhone_le.text() # 账户联系方式
        accountPwd=self.password_le.text() # 账户密码
        accountConfirePwd=self.confirm_pwd_le.text() # 账户确认密码
        # 获取注册用户参数限制条件
        configPath = os.path.join(os.getcwd(), "config", "config.json")
        # 是否包含中文
        isContainChinese=self.isContainChinese(accountName)
        # 获取配置文件配置限制参数
        try:
            dboperate=DBOperate.DBOperate()
            querySql="SELECT * FROM config_paras"
            paras=dboperate.QueryAsDict(querySql)[0]
        except Exception as ex:
            print(f"加载配置文件参数出错\n{ex}")
        else:
            accountMinChar = int(paras.get("accountMinChar", 5))
            accountNameContainChineseMinChar = int(paras.get("accountNameContainChineseMinChar", 6))
            accountNameNotContainChineseMinChar = int(paras.get("accountNameNotContainChineseMinChar", 5))
            accountPwdMinChar = int(paras.get("accountPwdMinChar", 6))
            dboperate.CloseDB()

        if len(account.encode())

你可能感兴趣的:(Python添加用户判断)