问题描述
使用vue-wxlogin组件做的微信登录,昨天还好好地,今天早上发现,扫码后不跳转,控制台报错Uncaught DOMException: Failed to read the ‘cookie’ property from ‘Document’: The document is sandboxed and lacks the ‘allow-same-origin’ flag.
问题解决方法
打开node_modules包中找到vue-wxlogin,进入到vue-wxlogin.vue组件中,在iframe标签的sandbox属性中加上allow-same-origin再重新打包发布即可解决问题。添加位置如下图所示