Pārlūkot izejas kodu

图片文件名存在多个小数点

lifanagju_citu 4 mēneši atpakaļ
vecāks
revīzija
0bb1c55e16

+ 3 - 0
components.d.ts

@@ -72,4 +72,7 @@ declare module 'vue' {
     VerifySlide: typeof import('./src/components/Verifition/Verify/VerifySlide.vue')['default']
     WangEditor: typeof import('./src/components/FormUI/wangEditor/index.vue')['default']
   }
+  export interface ComponentCustomProperties {
+    vLoading: typeof import('element-plus/es')['ElLoadingDirective']
+  }
 }

+ 2 - 1
src/components/Upload/img.vue

@@ -63,7 +63,8 @@ const handleUploadFile = async (e) => {
     return
   }
 
-  const fileType = file.name.split('.')[1]
+  const arr = file.name.split('.')
+  const fileType = arr?.length ? arr[arr.length-1] : ''
   if (!accept.includes(fileType)) return Snackbar.warning('请上传图片格式')
 
   const formData = new FormData()

+ 2 - 1
src/components/Upload/imgs.vue

@@ -71,7 +71,8 @@ const handleUploadFile = async (e) => {
     return
   }
 
-  const fileType = file.name.split('.')[1]
+  const arr = file.name.split('.')
+  const fileType = arr?.length ? arr[arr.length-1] : ''
   if (!accept.includes(fileType)) return Snackbar.warning('请上传图片格式')
 
   const formData = new FormData()

+ 2 - 1
src/plugins/dialogExtend/components/infoForm.vue

@@ -257,7 +257,8 @@ const handleUploadFile = async (e) => {
   const file = e.target.files[0]
   if (!file) return
 
-  const fileType = file.name.split('.')[1]
+  const arr = file.name.split('.')
+  const fileType = arr?.length ? arr[arr.length-1] : ''
   if (!accept.includes(fileType)) return Snackbar.warning('请上传图片格式文件')
 
   const size = file.size

+ 2 - 8
src/views/mall/components/details/prizeDrawContent.vue

@@ -74,13 +74,7 @@ const loading = ref(false)
 // const handleSearch = () => {}
 
 // 数据
-const dataList = ref([
-  { name: '凯悦酒店1866/2晚的房券-大床带双早', id: '1', image: 'https://img1.baidu.com/it/u=2383065711,2021783868&fm=253&fmt=auto&app=138&f=JPEG?w=719&h=500', time: '2025.02.01-2025.02.30' },
-  { name: '房券-高端酒店房券', id: '2', image: 'https://img1.baidu.com/it/u=1781363061,1773318172&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500', time: '2025.01.01-2025.12.30' },
-  { name: '金茂万丽免房券', id: '3', image: 'https://img1.baidu.com/it/u=1791205046,4251623717&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=375', time: '2025.01.01-2025.12.30' },
-  { name: '苏州昆山阳澄喜柯大酒店1晚套餐通兑券(住园景/全湖景尊享房+双人份豪华早餐+可自选蟹宴/价值198元正餐+免费使用泳池健身房)', id: '4', image: 'https://img2.baidu.com/it/u=4056160349,3161141178&fm=253&fmt=auto&app=138&f=JPEG?w=668&h=500', time: '2025.01.01-2025.12.30' },
-  { name: '上海万怡酒店房券+迪士尼门票', id: '5', image: 'https://picx.zhimg.com/v2-d21746f72d02ee821e35c6db11c0935f_r.jpg?source=1940ef5c', time: '2025.01.01-2025.12.30' }
-])
+const dataList = ref([])
 
 // 获取房券列表
 const getDataList = async () => {
@@ -88,7 +82,7 @@ const getDataList = async () => {
   try {
     const data = await getPrizeByLotteryId(props.lotteryId)
     dataList.value = data || []
-    console.log('获取房券列表:', data)
+    // console.log('获取房券列表:', data)
   } finally {
     loading.value = false
   }

+ 2 - 1
src/views/recruit/enterprise/entInfoSetting/informationSettingsComponents/enterpriseAlbum.vue

@@ -111,7 +111,8 @@ const handleUploadFile = async (e) => {
     return
   }
 
-  const fileType = file.name.split('.')[1]
+  const arr = file.name.split('.')
+  const fileType = arr?.length ? arr[arr.length-1] : ''
   if (!accept.includes(fileType)) return Snackbar.warning('文件格式不正确')
   const isImage = ['jpg', 'png', 'jpeg'].includes(fileType)
 

+ 2 - 1
src/views/recruit/enterprise/staffInfoSetting/index.vue

@@ -137,7 +137,8 @@ const handleUploadFile = async (e) => {
   const file = e.target.files[0]
   if (!file) return
 
-  const fileType = file.name.split('.')[1]
+  const arr = file.name.split('.')
+  const fileType = arr?.length ? arr[arr.length-1] : ''
   if (!accept.includes(fileType)) return Snackbar.warning('请上传图片格式文件')
 
   const size = file.size

+ 2 - 1
src/views/recruit/enterprise/systemManagement/groupAccount/index.vue

@@ -301,7 +301,8 @@ const handleUploadFile = async (e) => {
   const file = e.target.files[0]
   if (!file) return
 
-  const fileType = file.name.split('.')[1]
+  const arr = file.name.split('.')
+  const fileType = arr?.length ? arr[arr.length-1] : ''
   if (!accept.includes(fileType)) return Snackbar.warning('请上传图片格式文件')
 
   const reader = new FileReader()

+ 2 - 1
src/views/recruit/personal/PersonalCenter/resume/analysis/components/avatar.vue

@@ -53,7 +53,8 @@ const isShowCopper = ref(false)
 const accept = ['jpg', 'png', 'jpeg']
 const handleUploadFile = async (e) => {
   const file = e.target.files[0]
-  const fileType = file.name.split('.')[1]
+  const arr = file.name.split('.')
+  const fileType = arr?.length ? arr[arr.length-1] : ''
   if (!accept.includes(fileType)) return Snackbar.warning('请上传图片格式')
   const reader = new FileReader()
   reader.readAsDataURL(file)

+ 2 - 1
src/views/recruit/personal/PersonalCenter/resume/online/analysis/avatar.vue

@@ -53,7 +53,8 @@ const isShowCopper = ref(false)
 const accept = ['jpg', 'png', 'jpeg']
 const handleUploadFile = async (e) => {
   const file = e.target.files[0]
-  const fileType = file.name.split('.')[1]
+  const arr = file.name.split('.')
+  const fileType = arr?.length ? arr[arr.length-1] : ''
   if (!accept.includes(fileType)) return Snackbar.warning('请上传图片格式')
   const reader = new FileReader()
   reader.readAsDataURL(file)

+ 2 - 1
src/views/recruit/personal/PersonalCenter/resume/online/components/basicInfo.vue

@@ -166,7 +166,8 @@ const isShowCopper = ref(false)
 const accept = ['jpg', 'png', 'jpeg']
 const handleUploadFile = async (e) => {
   const file = e.target.files[0]
-  const fileType = file.name.split('.')[1]
+  const arr = file.name.split('.')
+  const fileType = arr?.length ? arr[arr.length-1] : ''
   if (!accept.includes(fileType)) return Snackbar.warning('请上传图片格式')
   const reader = new FileReader()
   reader.readAsDataURL(file)