Explorar el Código

【测试postmessa通信end】

master
GL hace 4 años
padre
commit
18fdb5609b
Se han modificado 1 ficheros con 13 adiciones y 7 borrados
  1. +13
    -7
      src/views/login/index.vue

+ 13
- 7
src/views/login/index.vue Ver fichero

@@ -43,7 +43,7 @@ export default {
loginImgUrl: require('../../assets/images/logo.png'), loginImgUrl: require('../../assets/images/logo.png'),
username: '18872592633', username: '18872592633',
password: '123456GD', password: '123456GD',
appId:'',
appId:"wx9ff823abeef23b94"
}; };
}, },
created() { created() {
@@ -71,14 +71,20 @@ export default {
} }
}) })
}, },

}, },
mounted() { mounted() {
//接收 父级盒子传入的appid
window.addEventListener('message',function(event){
this.appId = event.data
}, false);
window.addEventListener(
"message",
event => {
if (event.origin === "https://bh5test.malls.iformall.com/") {
let tempAppid = event.data;
this.appId = tempAppid
}else{
return
}
},
false
);
}, },
}; };
</script> </script>


Cargando…
Cancelar
Guardar