Ejemplo n.º 1
0
def user_flag(dd_status, uname):
    """
    用户登录状态
    :param dd_status:
    :type dd_status:
    :param uname:
    :type uname:
    :return:
    :rtype:
    """
    if dd_status:
        # cookies = dingding.dd_login_status(uname, has_dd=True)
        pass
    else:
        # if (input("是否保存钉钉帐户密码,保存后可后免登陆学习(Y/N) ")) not in ["y", "Y"]:
        if True:
            driver_login = mydriver.Mydriver(nohead=False)
            # 删除登录二维码
            # path = '../login.png'
            # if delete_folder.delete_file(path):
            cookies = driver_login.login()
            # else:
            #     print("删除二维码出错")
        else:
            # cookies = dingding.dd_login_status(uname)
            pass
    a_log = user.get_a_log(uname)
    v_log = user.get_v_log(uname)

    return cookies, a_log, v_log
Ejemplo n.º 2
0
def user_flag(dd_status, uname):
    if dd_status:
        cookies = dingding.dd_login_status(uname, has_dd=True)
    else:
        if (input("是否保存钉钉帐户密码,保存后可后免登陆学习(Y/N) ")) not in ["y", "Y"]:
            driver_login = mydriver.Mydriver(nohead=False)
            cookies = driver_login.login()
        else:
            cookies = dingding.dd_login_status(uname)
    a_log = user.get_a_log(uname)
    v_log = user.get_v_log(uname)

    return cookies, a_log, v_log
Ejemplo n.º 3
0
def user_flag(dd_status, uname):
    driver_login = mydriver.Mydriver(nohead=False)
    cookies = driver_login.login()

    print(cookies)

    itchat.auto_login(hotReload=True)
    # 这里修改要发送的用户名
    wechat_users = itchat.search_friends(name=u'张三')
    # itchat.send("这是一条系统自动发送的消息,请扫描二维码登录学习强国", toUserName=wechat_users[0]["UserName"]);

    a_log = user.get_a_log(uname)
    v_log = user.get_v_log(uname)

    return cookies, a_log, v_log, wechat_users
Ejemplo n.º 4
0
def user_flag(dd_status, uname):
    if False and dd_status:
        cookies = dingding.dd_login_status(uname, has_dd=True)
    else:
        # if (input("是否保存钉钉帐户密码,保存后可后免登陆学习(Y/N) ")) not in ["y", "Y"]:
        if True:
            cookies = user.get_cookie(uname)
            if not cookies:
                print("未找到有效登录信息,需要登录")
                driver_login = Mydriver(nohead=False)
                cookies = driver_login.login()
                driver_login.quit()
        else:
            cookies = dingding.dd_login_status(uname)
    a_log = user.get_a_log(uname)
    v_log = user.get_v_log(uname)
    d_log = user.get_d_log(uname)
    return cookies, a_log, v_log, d_log