diff --git a/package.json b/package.json index c8700605..dc3a1f35 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "event-source-polyfill": "^1.0.31", "global": "^4.4.0", "jetlinks-store": "^0.0.3", - "jetlinks-ui-components": "^1.0.34-7", + "jetlinks-ui-components": "^1.0.34-12", "js-cookie": "^3.0.1", "jsencrypt": "^3.3.2", "less": "^4.1.3", diff --git a/src/App.vue b/src/App.vue index 0c14af16..376264e4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -10,11 +10,23 @@ import zhCN from 'jetlinks-ui-components/es/locale/zh_CN'; import { storeToRefs } from 'pinia'; import { useSystem } from './store/system'; import DefaultSetting from '../config/config' +import {LocalStore} from "@/utils/comm"; +import {TOKEN_KEY} from "@/utils/variable"; const system = useSystem(); const {configInfo} = storeToRefs(system); system.setDocumentTitle() + +const route = useRoute() + +watch(() => JSON.stringify(route.query || {}), () => { + if (route.query.token) { + LocalStore.set(TOKEN_KEY, route.query.token); + } +}, { immediate: true }) + + ConfigProvider.config({ theme: { primaryColor: "#315efb" diff --git a/src/components/Layout/BasicLayoutPage.vue b/src/components/Layout/BasicLayoutPage.vue index dbabb304..1e974fe2 100644 --- a/src/components/Layout/BasicLayoutPage.vue +++ b/src/components/Layout/BasicLayoutPage.vue @@ -4,8 +4,8 @@ v-model:collapsed="basicLayout.collapsed" v-model:openKeys="basicLayout.openKeys" :selectedKeys="basicLayout.selectedKeys" - :headerHeight='layout.headerHeight' - :breadcrumb="{ routes: breadcrumbs }" + :breadcrumb="basicLayout.pure ? undefined : { routes: breadcrumbs }" + :headerHeight='basicLayout.pure ? 1 : layout.headerHeight' :pure="basicLayout.pure" @backClick='routerBack' > diff --git a/src/utils/menu.ts b/src/utils/menu.ts index c7c03188..143e1e12 100644 --- a/src/utils/menu.ts +++ b/src/utils/menu.ts @@ -159,11 +159,11 @@ const extraRouteObj = { type Buttons = Array<{ id: string }> const hasAppID = (item: any): { isApp: boolean, appUrl: string } => { - const isApp = !!item.appId + const isApp = !!item.appId || item.options?.owner const isLowCode = !!item.options?.LowCode return { isApp: isApp || isLowCode, - appUrl: isApp ? `/${item.appId}${item.url}` : item.url + appUrl: isApp ? `/${item.appId || item.options?.owner}${item.url}` : item.url } } diff --git a/src/views/iframe/index.vue b/src/views/iframe/index.vue index 6f234554..797e51b8 100644 --- a/src/views/iframe/index.vue +++ b/src/views/iframe/index.vue @@ -48,17 +48,18 @@ const handle = async (appId: string, url: string) => { } } + const _url = menuUrl.startsWith('/') ? menuUrl : `/${menuUrl}`; + if (result.provider === 'internal-standalone') { const urlStandalone = `${result.page.baseUrl}/api/application/sso/${appId}/login?redirect=${menuUrl}?layout=false`; iframeUrl.value = urlStandalone; } else if (result.provider === 'internal-integrated') { - const _url = menuUrl.startsWith('/') ? menuUrl : `/${menuUrl}`; const tokenUrl = `${ result.page.baseUrl }${_url}?layout=false&X-Access-Token=${LocalStore.get(TOKEN_KEY)}`; iframeUrl.value = tokenUrl; } else { - const urlOther = `${result.page.baseUrl}/${menuUrl}`; + const urlOther = `${result.page.baseUrl}${_url}`; iframeUrl.value = urlOther; } } @@ -106,6 +107,7 @@ watchEffect(() => { } else { loading.value = true const url = route.path.split('/').slice(2).join('/'); + console.log(route.path.split('/').slice(2)) handle(params, url); } } diff --git a/yarn.lock b/yarn.lock index 11df283f..093c3df7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3738,10 +3738,10 @@ jetlinks-store@^0.0.3: resolved "https://registry.npmjs.org/jetlinks-store/-/jetlinks-store-0.0.3.tgz" integrity sha512-AZf/soh1hmmwjBZ00fr1emuMEydeReaI6IBTGByQYhTmK1Zd5pQAxC7WLek2snRAn/HHDgJfVz2hjditKThl6Q== -jetlinks-ui-components@^1.0.34-7: - version "1.0.34-7" - resolved "https://registry.npmjs.org/jetlinks-ui-components/-/jetlinks-ui-components-1.0.34-7.tgz#3a14e85edb4c5d11427d30f3925dc5f498478940" - integrity sha512-Rgbjig3QYP8CDVHLbco20Cf7sArYralO8yWtH5E5zylYAN2lINLUsgOlIVf9aweszZR/Ps+z/NLP0CoRQf1Xtw== +jetlinks-ui-components@^1.0.34-12: + version "1.0.34-12" + resolved "https://registry.npmjs.org/jetlinks-ui-components/-/jetlinks-ui-components-1.0.34-12.tgz#13e035bae1d16af957d81a175daaa3a2fe290406" + integrity sha512-fxoncKov8IsScneXQYcaBwg+HnXrkJSaS7z9aV7uZK4/WxvTaAWozOPIOSkBwfDya+BuRpbJ9ZW3X9MtT6kLrQ== dependencies: "@vueuse/core" "^9.12.0" "@vueuse/router" "^9.13.0"