iframe.js 812 B

1234567891011121314151617181920212223242526272829303132
  1. const { createApp, ref ,onMounted,createVNode, render,beforeCreate} = Vue
  2. createApp({
  3. setup() {
  4. onMounted(()=>{
  5. createIframeUrl()
  6. })
  7. const url = ref('')
  8. const createIframeUrl = ()=>{
  9. let path = tool.getQueryParam('path')
  10. let token = sessionStorage.getItem('token')
  11. url.value = `${DynamicAcquisitionURL()}/yosweb/index.html#/bridge?token=${token}&path=${path}`
  12. console.log(url.value)
  13. }
  14. const DynamicAcquisitionURL = ()=> {
  15. var str = window.location.href;
  16. var index = str.indexOf('/');
  17. var num = 0;
  18. while(index !== -1) {
  19. num++;
  20. index = str.indexOf('/',index + 1);
  21. if (num++ === 3) {
  22. return str.slice(0, index);
  23. }
  24. }
  25. }
  26. return {
  27. url
  28. }
  29. }
  30. }).mount('#app')