From f01f3064499d50f7c26e5050fe170cf809edb8a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=B6=E5=90=AF=E9=BE=99?= Date: Sun, 1 Sep 2024 15:45:39 +0800 Subject: [PATCH] fix: modify --- packages/common/utils/url.ts | 2 +- webs/log-web/src/views/iframe.vue | 2 +- webs/oms-web/src/views/iframe.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/common/utils/url.ts b/packages/common/utils/url.ts index 20c0fae..0fcf66e 100644 --- a/packages/common/utils/url.ts +++ b/packages/common/utils/url.ts @@ -1,4 +1,4 @@ -export function appendParamsToUrl(url: string, pathname: string, params: Record) { +export function appendParamsToUrl(url = '', pathname = '', params: Record = {}) { // 创建一个新的URL对象,在末尾添加 pathname const urlObject = new URL(pathname, url) diff --git a/webs/log-web/src/views/iframe.vue b/webs/log-web/src/views/iframe.vue index 51a4303..f80a77a 100644 --- a/webs/log-web/src/views/iframe.vue +++ b/webs/log-web/src/views/iframe.vue @@ -26,7 +26,7 @@ export default { token: getToken(), ...(this.$route.query || {}) } - const url = appendParamsToUrl(this.url, this.$route.path + this.$route.meta?.pathname, params) + const url = appendParamsToUrl(this.url, this.$route.path + (this.$route.meta?.pathname || ''), params) console.log('iframeUrl: ', url) return url } diff --git a/webs/oms-web/src/views/iframe.vue b/webs/oms-web/src/views/iframe.vue index 13f9487..8eac4f5 100644 --- a/webs/oms-web/src/views/iframe.vue +++ b/webs/oms-web/src/views/iframe.vue @@ -26,7 +26,7 @@ export default { token: getToken(), ...(this.$route.query || {}) } - const url = appendParamsToUrl(this.url, this.$route.path + this.$route.meta?.pathname, params) + const url = appendParamsToUrl(this.url, this.$route.path + (this.$route.meta?.pathname || ''), params) console.log('iframeUrl: ', url) return url }