diff --git a/web/app.vue b/web/app.vue index e79482d5b..0afd71334 100644 --- a/web/app.vue +++ b/web/app.vue @@ -19,7 +19,7 @@ import useMemberStore from '@/stores/member' import '@/assets/styles/index.scss' if (process.client) { - const match = location.href.match(/\/s(\d*)\//) + const match = location.href.match(/\/web\/(\d*)\//) const cookie = useCookie('siteId') match ? cookie.value = match[1] : cookie.value = null } diff --git a/web/utils/request.ts b/web/utils/request.ts index 247571647..f62f33b01 100644 --- a/web/utils/request.ts +++ b/web/utils/request.ts @@ -94,6 +94,7 @@ class Http { // 处理首次请求baseurl空的问题 const runtimeConfig = useRuntimeConfig() !this.options.baseURL && (this.options.baseURL = runtimeConfig.public.VITE_APP_BASE_URL || `${location.origin}/api/`) + this.options.baseURL.substr(-1) != '/' && (this.options.baseURL += '/') useFetch(url, { ...this.options }).then((response) => { const { data: { value }, error } = response