页面跨域存储参数

页面跨域存储参数

比如a.com要跳转到b.com(这种方式必须是在同一个页面打开,不是新建页面打开)

a页面

goMyPersonal () {
                let loginDate = {}
                loginDate.token = util.cookies.get('token');
                window.name = JSON.stringify(loginDate)
                window.location.href = 'http://b.com'//跳转地址
            },

b页面


if (window.name) {
       console.log(JSON.parse(window.name))
    }

猜你喜欢

转载自blog.csdn.net/qq706352062/article/details/108464405