Skip to content

Commit

Permalink
build: 处理一些console
Browse files Browse the repository at this point in the history
  • Loading branch information
feige996 committed Jun 16, 2024
1 parent 2870dcd commit f2177da
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
1 change: 0 additions & 1 deletion manifest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { loadEnv } from 'vite'

// 获取环境变量的范例
const env = loadEnv(process.env.NODE_ENV!, path.resolve(process.cwd(), 'env'))
// console.log(env)
const {
VITE_APP_TITLE,
VITE_UNI_APPID,
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/useUpload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function useUpload<T = string>(formData: Record<string, any> = {}
uploadFile<T>({ tempFilePath, formData, data, error, loading })
},
fail: (err) => {
console.log('uni.chooseMedia err->', err)
console.error('uni.chooseMedia err->', err)
error.value = true
},
})
Expand All @@ -37,7 +37,7 @@ export default function useUpload<T = string>(formData: Record<string, any> = {}
uploadFile<T>({ tempFilePath, formData, data, error, loading })
},
fail: (err) => {
console.log('uni.chooseImage err->', err)
console.error('uni.chooseImage err->', err)
error.value = true
},
})
Expand All @@ -57,7 +57,7 @@ function uploadFile<T>({ tempFilePath, formData, data, error, loading }) {
data.value = uploadFileRes.data as T
},
fail: (err) => {
console.log('uni.uploadFile err->', err)
console.error('uni.uploadFile err->', err)
error.value = true
},
complete: () => {
Expand Down
2 changes: 1 addition & 1 deletion src/interceptors/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const httpInterceptor = {
// 非 http 开头需拼接地址
if (!options.url.startsWith('http')) {
// #ifdef H5
console.log(__VITE_APP_PROXY__)
// console.log(__VITE_APP_PROXY__)
if (JSON.parse(__VITE_APP_PROXY__)) {
// 啥都不需要做
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const author = ref('菲鸽')
const description = ref(
'unibest 是一个集成了多种工具和技术的 uniapp 开发模板,由 uniapp + Vue3 + Ts + Vite4 + UnoCss + UniUI + VSCode 构建,模板具有代码提示、自动格式化、统一配置、代码片段等功能,并内置了许多常用的基本组件和基本功能,让你编写 uniapp 拥有 best 体验。',
)

// 测试 uni API 自动引入
onLoad(() => {
console.log(author)
})
Expand Down
5 changes: 2 additions & 3 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-expect-error import json file
import { pages, subPackages, tabBar } from '@/pages.json'

/** 判断当前页面是否是tabbar页 */
Expand Down Expand Up @@ -31,7 +30,7 @@ export const currRoute = () => {
// console.log('lastPage.options:', (lastPage as any).options)
// 经过多端测试,只有 fullPath 靠谱,其他都不靠谱
const { fullPath } = currRoute as { fullPath: string }
console.log(fullPath)
// console.log(fullPath)
// eg: /pages/login/index?redirect=%2Fpages%2Fdemo%2Fbase%2Froute-interceptor (小程序)
// eg: /pages/login/index?redirect=%2Fpages%2Froute-interceptor%2Findex%3Fname%3Dfeige%26age%3D30(h5)
return getUrlObj(fullPath)
Expand Down Expand Up @@ -97,7 +96,7 @@ export const getAllPages = (key = 'needLogin') => {
})
})
const result = [...mainPages, ...subPages]
console.log(`getAllPages by ${key} result: `, result)
// console.log(`getAllPages by ${key} result: `, result)
return result
}

Expand Down

0 comments on commit f2177da

Please sign in to comment.