wujie icon indicating copy to clipboard operation
wujie copied to clipboard

部署到公网上从主应用访问子应用有时加载不出来,但是在内网是可以稳定加载出来的

Open thinkiveWJ opened this issue 8 months ago • 2 comments

版本:[email protected] bug描述: 部署到公网环境,从主应用访问子应用,有时候子应用可以加载出来,有时候加载不出来【加载不出来的时候,子应用window上没有任何wujie相关的属性】; 子应用加载不出来的时候,刷新页面有时候就加载出来了; 子应用加载不出来时候的报错信息是:报错[wujie error]: 脚本请求出现错误 http://2.1.1.2:89/cookie/flash.js 部署到局域网环境,一切正常 开发环境下一切正常

我目前的解决方式是降级到[email protected], 暂时没有发现上面的bug

<template>
  <WujieVue
    width="100%"
    height="100%"
    :sync="true"
    :url="url"
    :props="props"
    name="sub_order"
  />
</template>

<script lang="ts" setup>
import WujieVue from 'wujie-vue3'
import { computed } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { useLoginStore } from '@/stores/login/index'
const loginStore = useLoginStore()
const router = useRouter()
const route = useRoute()
const isDev = process.env.NODE_ENV === 'development'
const url = computed(() => {
  const path = (route.path || '/').replace('/sub_order', '/subOrder')
  return isDev ? `//localhost:9012${path}/` : path
})

const props = {
  jumpTo: (params: any) => router.push(params),
  headers: {
    'X-Access-Token': loginStore?.userInfo?.token,
    'X-Tenant-Id': loginStore?.userInfo?.userInfo?.loginTenantId
  }
}

</script>

<style lang="scss" scoped>

</style>

thinkiveWJ avatar Apr 24 '25 00:04 thinkiveWJ

部署在公网上使用http,访问者的网络中如果使用了一些安全设置,例如深信服,会被偶发拦截

chengkai2022 avatar Apr 30 '25 03:04 chengkai2022

有时候加载不出来:加preload 脚本请求出现错误:添加到jsignore让子应用自己加载这个js就行了

ngwszsd avatar Apr 30 '25 09:04 ngwszsd