diff --git a/front/src/composables/updateQueryString.ts b/front/src/composables/updateQueryString.ts index 98d3a3891..84873d067 100644 --- a/front/src/composables/updateQueryString.ts +++ b/front/src/composables/updateQueryString.ts @@ -1,9 +1,5 @@ export default (uri: string, key: string, value: string) => { - const re = new RegExp(`([?&])${key}=.*?(&|$)`, 'i') - if (uri.match(re)) { - return uri.replace(re, `$1${key}=${value}$2`) - } else { - const separator = uri.indexOf('?') !== -1 ? '&' : '?' - return `${uri}${separator}${key}=${value}` - } + const url = new URL(uri) + url.searchParams.set(key, value) + return url.href } diff --git a/front/src/main.ts b/front/src/main.ts index b9471207b..500cbbd86 100644 --- a/front/src/main.ts +++ b/front/src/main.ts @@ -21,8 +21,6 @@ const app = createApp({ components: { App: () => import('~/App.vue') }, - setup () { - }, data: () => ({ isMounted: false }), async mounted () { this.isMounted = true