Merge branch 'base' into i18n

This commit is contained in:
菲鸽 2024-06-16 16:47:24 +08:00
commit 27bb4101ff
5 changed files with 7 additions and 9 deletions

View File

@ -5,7 +5,6 @@ import { loadEnv } from 'vite'
// 获取环境变量的范例 // 获取环境变量的范例
const env = loadEnv(process.env.NODE_ENV!, path.resolve(process.cwd(), 'env')) const env = loadEnv(process.env.NODE_ENV!, path.resolve(process.cwd(), 'env'))
// console.log(env)
const { const {
VITE_APP_TITLE, VITE_APP_TITLE,
VITE_UNI_APPID, VITE_UNI_APPID,

View File

@ -23,7 +23,7 @@ export default function useUpload<T = string>(formData: Record<string, any> = {}
uploadFile<T>({ tempFilePath, formData, data, error, loading }) uploadFile<T>({ tempFilePath, formData, data, error, loading })
}, },
fail: (err) => { fail: (err) => {
console.log('uni.chooseMedia err->', err) console.error('uni.chooseMedia err->', err)
error.value = true error.value = true
}, },
}) })
@ -37,7 +37,7 @@ export default function useUpload<T = string>(formData: Record<string, any> = {}
uploadFile<T>({ tempFilePath, formData, data, error, loading }) uploadFile<T>({ tempFilePath, formData, data, error, loading })
}, },
fail: (err) => { fail: (err) => {
console.log('uni.chooseImage err->', err) console.error('uni.chooseImage err->', err)
error.value = true error.value = true
}, },
}) })
@ -57,7 +57,7 @@ function uploadFile<T>({ tempFilePath, formData, data, error, loading }) {
data.value = uploadFileRes.data as T data.value = uploadFileRes.data as T
}, },
fail: (err) => { fail: (err) => {
console.log('uni.uploadFile err->', err) console.error('uni.uploadFile err->', err)
error.value = true error.value = true
}, },
complete: () => { complete: () => {

View File

@ -28,7 +28,7 @@ const httpInterceptor = {
// 非 http 开头需拼接地址 // 非 http 开头需拼接地址
if (!options.url.startsWith('http')) { if (!options.url.startsWith('http')) {
// #ifdef H5 // #ifdef H5
console.log(__VITE_APP_PROXY__) // console.log(__VITE_APP_PROXY__)
if (JSON.parse(__VITE_APP_PROXY__)) { if (JSON.parse(__VITE_APP_PROXY__)) {
// 啥都不需要做 // 啥都不需要做
} else { } else {

View File

@ -44,7 +44,7 @@ const author = ref('菲鸽')
const description = ref( const description = ref(
'unibest 是一个集成了多种工具和技术的 uniapp 开发模板,由 uniapp + Vue3 + Ts + Vite4 + UnoCss + UniUI + VSCode 构建,模板具有代码提示、自动格式化、统一配置、代码片段等功能,并内置了许多常用的基本组件和基本功能,让你编写 uniapp 拥有 best 体验。', 'unibest 是一个集成了多种工具和技术的 uniapp 开发模板,由 uniapp + Vue3 + Ts + Vite4 + UnoCss + UniUI + VSCode 构建,模板具有代码提示、自动格式化、统一配置、代码片段等功能,并内置了许多常用的基本组件和基本功能,让你编写 uniapp 拥有 best 体验。',
) )
// uni API
onLoad(() => { onLoad(() => {
console.log(author) console.log(author)
}) })

View File

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