Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

正在修改移动端模拟登陆。 但是无法填写用户名和密码,有什么好的思路? #90

Open
eromoe opened this issue Apr 4, 2020 · 0 comments

Comments

@eromoe
Copy link

eromoe commented Apr 4, 2020

$('#username').val('{username}');

主要是这块,我改成下面的


        if host == 'plogin.m.jd.com':
            code = """

            $('.planBLogin').click();

            console.log($('#username'));
            console.log($('#pwd'));

            setTimeout(function() {{
                
                console.log(11111);
                console.log($('#username'));
                console.log($('#pwd'));

                $('#username').click();
                $('#username').focus();
                $('#username').trigger('touchstart');
                $('#username').trigger('touchmove');
                $('#username').val('{username}');
                $('#username').trigger('touchend');

                $('#pwd').click();
                $('#pwd').focus();
                $('#pwd').trigger('touchstart');
                $('#pwd').trigger('touchmove');
                $('#pwd').val('{password}');
                $('#pwd').trigger('touchend');

            }}, 4000);

            setTimeout(function() {{
                
                console.log(2222222);

                if ({auto_submit}) {{
                    $('.btn.J_ping').addClass('btn-active');
                    $('.btn.J_ping').click();
                    $('.btn.J_ping').trigger('touchstart');
                    $('.btn.J_ping').trigger('touchmove');
                    $('.btn.J_ping').trigger('touchend');
                }} else {{
                    $('#username').focus();
                }}

            }}, 6000);


            """

为了方便我把jquery 嵌进去了,然后模拟点击。
但是没有效果,好像京东用 vue / reactjs 之类的框架开发的,自己搞了一套事件,导致 click 和 touch 没有效果。

但是照常理来说,点击和触摸事件应该是公共的啊,为什么用户点击的能触发,用js 就不能触发

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant