from unitls.LogerinTxt import app_logger
from .flightDB import flightDB


def changepassword(loginTabledb:flightDB,user,old,new):
    try:
        newdic={"密码":"'%s'"%new}
        loginTabledb.upDateItem("logintable",newdic,"登录名='%s' and 密码='%s'"%(user,old))
        loginTabledb.close()
    except Exception as e:
        app_logger.log_error(e)
