Skip to content

Commit

Permalink
fix: env utils 方法名称拼写问题
Browse files Browse the repository at this point in the history
  • Loading branch information
GeraltWang authored and Burt committed Dec 10, 2024
1 parent e077f9c commit 0e77899
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/hooks/useUpload.ts
Original file line number Diff line number Diff line change
@@ -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 是一个定制化的请求钩子,用于处理上传图片。
Expand Down
4 changes: 2 additions & 2 deletions src/interceptors/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, any>
Expand All @@ -11,7 +11,7 @@ export type CustomRequestOptions = UniApp.RequestOptions & {
} & IUniUploadFileOptions // 添加uni.uploadFile参数类型

// 请求基准地址
const baseUrl = getEvnBaseUrl()
const baseUrl = getEnvBaseUrl()

// 拦截器配置
const httpInterceptor = {
Expand Down
4 changes: 2 additions & 2 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -151,7 +151,7 @@ export const getEvnBaseUrl = () => {
/**
* 根据微信小程序当前环境,判断应该获取的UPLOAD_BASEURL
*/
export const getEvnBaseUploadUrl = () => {
export const getEnvBaseUploadUrl = () => {
// 请求基准地址
let baseUploadUrl = import.meta.env.VITE_UPLOAD_BASEURL

Expand Down

0 comments on commit 0e77899

Please sign in to comment.