From 2302ff35e85987c0ece8739c4c7352c1fc81267e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=89=91=E6=9C=AF?= <27618209+icjs-cc@users.noreply.github.com> Date: Tue, 3 Dec 2024 21:51:28 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=E8=A7=A3=E5=86=B3vscode=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E7=B1=BB=E5=9E=8B=E2=80=9CIntrinsicElements=E2=80=9D?= =?UTF-8?q?=E4=B8=8A=E4=B8=8D=E5=AD=98=E5=9C=A8=E5=B1=9E=E6=80=A7=E2=80=9C?= =?UTF-8?q?template=E2=80=9D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tsconfig.json | 1 - 1 file changed, 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 8d5bd6a..c0755ed 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,7 +23,6 @@ ] }, "vueCompilerOptions": { - "target": 3, "plugins": ["@uni-helper/uni-types/volar-plugin"] }, "exclude": ["node_modules"], From 0e77899084dd101de45a5aeee9b6d752ff8888af Mon Sep 17 00:00:00 2001 From: GeraltWang Date: Tue, 10 Dec 2024 09:57:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20env=20utils=20=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E6=8B=BC=E5=86=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useUpload.ts | 4 ++-- src/interceptors/request.ts | 4 ++-- src/utils/index.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hooks/useUpload.ts b/src/hooks/useUpload.ts index b043cfd..adc083d 100644 --- a/src/hooks/useUpload.ts +++ b/src/hooks/useUpload.ts @@ -1,7 +1,7 @@ // TODO: 别忘加更改环境变量的 VITE_UPLOAD_BASEURL 地址。 -import { getEvnBaseUploadUrl } from '@/utils' +import { getEnvBaseUploadUrl } from '@/utils' -const VITE_UPLOAD_BASEURL = `${getEvnBaseUploadUrl()}` +const VITE_UPLOAD_BASEURL = `${getEnvBaseUploadUrl()}` /** * useUpload 是一个定制化的请求钩子,用于处理上传图片。 diff --git a/src/interceptors/request.ts b/src/interceptors/request.ts index 79c0a49..1f84b31 100644 --- a/src/interceptors/request.ts +++ b/src/interceptors/request.ts @@ -2,7 +2,7 @@ import qs from 'qs' import { useUserStore } from '@/store' import { platform } from '@/utils/platform' -import { getEvnBaseUrl } from '@/utils' +import { getEnvBaseUrl } from '@/utils' export type CustomRequestOptions = UniApp.RequestOptions & { query?: Record @@ -11,7 +11,7 @@ export type CustomRequestOptions = UniApp.RequestOptions & { } & IUniUploadFileOptions // 添加uni.uploadFile参数类型 // 请求基准地址 -const baseUrl = getEvnBaseUrl() +const baseUrl = getEnvBaseUrl() // 拦截器配置 const httpInterceptor = { diff --git a/src/utils/index.ts b/src/utils/index.ts index 70131bf..be21dd6 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -122,7 +122,7 @@ export const needLoginPages: string[] = getAllPages('needLogin').map((page) => p /** * 根据微信小程序当前环境,判断应该获取的BaseUrl */ -export const getEvnBaseUrl = () => { +export const getEnvBaseUrl = () => { // 请求基准地址 let baseUrl = import.meta.env.VITE_SERVER_BASEURL @@ -151,7 +151,7 @@ export const getEvnBaseUrl = () => { /** * 根据微信小程序当前环境,判断应该获取的UPLOAD_BASEURL */ -export const getEvnBaseUploadUrl = () => { +export const getEnvBaseUploadUrl = () => { // 请求基准地址 let baseUploadUrl = import.meta.env.VITE_UPLOAD_BASEURL