V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
leaveeel

87 版本 chrome 无法登录跳转

  •  
  •   leaveeel · Dec 28, 2020 · 1213 views
    This topic created in 1946 days ago, the information mentioned may be changed or developed.

    老项目后台登录用的 ajax 请求拼接地址,获取到true后登录成功跳转到首页。现在新版 chrome 87.0.4280.88 (正式版本) ( 64 位) 登录仅刷新登录页面,控制台header返回 200,参数正确。response/preview显示failed to load resource data。在 ff 内正常跳转,61.0.x版本的 chrome 也没问题,其他版本没有测试。手动新窗口打开接口地址可以看到返回数据,回到登录页刷新成功跳转到首页

    代码:

    
    $.ajax({
    	dataType: 'jsonp',
        url: 'https://xxx/xx?callback=login&username=xxx&password=xxx',
        success: function(data){}
    })
    
    function login(result) {
    	if(result.success) {
        	window.location.href = '/'
        }else {....}
    }
    
    

    试了window.onbeforeunload确实可以在控制台看到返回数据了,但继续执行还是无法登录跳转。该如何处理这个问题

    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5082 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 01:10 · PVG 09:10 · LAX 18:10 · JFK 21:10
    ♥ Do have faith in what you're doing.