update web

This commit is contained in:
全栈小学生 2023-06-21 16:57:03 +08:00
parent b8b58102e2
commit 5b6563a16e
2 changed files with 2 additions and 1 deletions

View File

@ -19,7 +19,7 @@ import useMemberStore from '@/stores/member'
import '@/assets/styles/index.scss' import '@/assets/styles/index.scss'
if (process.client) { if (process.client) {
const match = location.href.match(/\/s(\d*)\//) const match = location.href.match(/\/web\/(\d*)\//)
const cookie = useCookie('siteId') const cookie = useCookie('siteId')
match ? cookie.value = match[1] : cookie.value = null match ? cookie.value = match[1] : cookie.value = null
} }

View File

@ -94,6 +94,7 @@ class Http {
// 处理首次请求baseurl空的问题 // 处理首次请求baseurl空的问题
const runtimeConfig = useRuntimeConfig() const runtimeConfig = useRuntimeConfig()
!this.options.baseURL && (this.options.baseURL = runtimeConfig.public.VITE_APP_BASE_URL || `${location.origin}/api/`) !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) => { useFetch(url, { ...this.options }).then((response) => {
const { data: { value }, error } = response const { data: { value }, error } = response