index.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <div v-sd-watermark="waterMark" class="search">
  3. <div id="temp" class="search"> </div>
  4. </div>
  5. </template>
  6. <script>
  7. import systemManage from '@/system-manage/system-manage'
  8. import appConfig from '@custom/app-config'
  9. export default {
  10. name: 'SuperSearch',
  11. metaInfo: {
  12. title: '超级审搜',
  13. },
  14. data() {
  15. return { iframe: null, waterMark: systemManage.getFormWaterMark() }
  16. },
  17. mounted() {
  18. this.postIframe()
  19. },
  20. methods: {
  21. postIframe() {
  22. const iframe = document.createElement('iframe')
  23. const bodyDom = document.getElementById('temp')
  24. iframe.id = 'iframe'
  25. iframe.classList.add('iframe')
  26. iframe.src = appConfig.searchBaseUrl + '#/'
  27. // iframe.src = 'http://127.0.0.1:8888/#/'
  28. // <!-- todo生产地址 10.104.1.174 -->
  29. // iframe.src = 'http://10.104.1.174/#/'
  30. this.iframe = iframe
  31. bodyDom.insertBefore(iframe, bodyDom.lastChild)
  32. const token = this.$store.state.sd.login.tokens.access_token
  33. iframe.onload = function() {
  34. // iframe.contentWindow.postMessage(JSON.stringify(token), 'http://10.104.32.31:9999/')
  35. // iframe.contentWindow.postMessage(JSON.stringify(token), 'http://127.0.0.1:8888')
  36. // <!-- todo生产地址 10.104.1.174 -->
  37. iframe.contentWindow.postMessage(JSON.stringify(token), appConfig.searchBaseUrl)
  38. }
  39. },
  40. },
  41. }
  42. </script>
  43. <style lang="scss">
  44. .search {
  45. width: 100%;
  46. height: 100%;
  47. #iframe {
  48. width: 100%;
  49. height: 100%;
  50. }
  51. }
  52. </style>