src/App.vue
@@ -5,26 +5,16 @@ </template> <script> import { isWeixin } from '@/utils/UA.js' import { getWxSignature } from '@/utils/wxjssdk.js' export default { data() { return { } return {} }, watch: { '$route.path': function(){ let count = localStorage.getItem('refreshCount') || 0 count = Number(count) + 1 localStorage.setItem('refreshCount', count++) if (isWeixin) { getWxSignature(this.$route) } }, }, created() { console.log('localHost') '$route': function() { getWxSignature() } } } </script>