Browse Source

修改图片后缀校验

shaogen1995 2 months ago
parent
commit
a1e7b78ed5

+ 2 - 1
src/pages/A_workbench/A4voucher/index.tsx

@@ -138,7 +138,8 @@ function A4voucher() {
               <Button size='small' type='text' onClick={() => tableBtnFu(item, '1')}>
                 查看
               </Button>
-              {downImg['图片'] === '原图和缩略图' && fileImgArr.includes(fileNameLast) ? (
+              {downImg['图片'] === '原图和缩略图' &&
+              fileImgArr.includes(fileNameLast.toLowerCase()) ? (
                 <Popconfirm
                   title='请选择图片规格'
                   onConfirm={() => downFileFu(item.filePath)}

+ 1 - 1
src/pages/B_enterTibet/B2identify/B2edit/B2MoAdd/index.tsx

@@ -38,7 +38,7 @@ function B2MoAdd({ info, closeFu, succFu, look = false }: Props) {
         const imgArr = arr.filter(v => {
           const txtArr = v.fileName.split('.')
           const txt = txtArr[txtArr.length - 1]
-          return v.type === 'img' && fileImgArr.includes(txt)
+          return v.type === 'img' && fileImgArr.includes(txt.toLowerCase())
         })
 
         // 设置图片

+ 1 - 1
src/pages/B_enterTibet/B34typeIn/B34MoAdd/index.tsx

@@ -45,7 +45,7 @@ function B34MoAdd({ info, closeFu, succFu, type, look = false }: Props) {
         const imgArr = arr.filter(v => {
           const txtArr = v.fileName.split('.')
           const txt = txtArr[txtArr.length - 1]
-          return v.type === 'img' && fileImgArr.includes(txt)
+          return v.type === 'img' && fileImgArr.includes(txt.toLowerCase())
         })
 
         // 设置图片

+ 3 - 3
src/pages/C_goodsManage/C1register/AddGoods/index.tsx

@@ -172,11 +172,11 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
           const fileNameArr = item.fileName.split('.')
           const fileNameLast = fileNameArr[fileNameArr.length - 1]
 
-          return fileImgArr.includes(fileNameLast) ? (
+          return fileImgArr.includes(fileNameLast.toLowerCase()) ? (
             <div className='tableImgAuto'>
               <ImageLazy width={60} height={60} srcBig={item.filePath} src={item.thumb} />
             </div>
-          ) : fileVideoArr.includes(fileNameLast) ? (
+          ) : fileVideoArr.includes(fileNameLast.toLowerCase()) ? (
             <YtableVideo src={item.filePath} />
           ) : (
             ' - '
@@ -288,7 +288,7 @@ function AddGoods({ nowSta, closeFu, succFu, isEdit, editSnap }: Props) {
       const imgArr = table.filter(v => {
         const txtArr = v.fileName.split('.')
         const txt = txtArr[txtArr.length - 1]
-        return v.type === 'img' && fileImgArr.includes(txt)
+        return v.type === 'img' && fileImgArr.includes(txt.toLowerCase())
       })
 
       let thumb = ''

+ 4 - 3
src/pages/C_goodsManage/C2files/index.tsx

@@ -136,11 +136,11 @@ function C2files() {
           const fileNameArr = item.fileName.split('.')
           const fileNameLast = fileNameArr[fileNameArr.length - 1]
 
-          return fileImgArr.includes(fileNameLast) ? (
+          return fileImgArr.includes(fileNameLast.toLowerCase()) ? (
             <div className='tableImgAuto'>
               <ImageLazy width={60} height={60} srcBig={item.filePath} src={item.thumb} />
             </div>
-          ) : fileVideoArr.includes(fileNameLast) ? (
+          ) : fileVideoArr.includes(fileNameLast.toLowerCase()) ? (
             <YtableVideo src={item.filePath} />
           ) : (
             ' - '
@@ -199,7 +199,8 @@ function C2files() {
           const fileNameLast = fileNameArr[fileNameArr.length - 1]
           return (
             <>
-              {downImg['图片'] === '原图和缩略图' && fileImgArr.includes(fileNameLast) ? (
+              {downImg['图片'] === '原图和缩略图' &&
+              fileImgArr.includes(fileNameLast.toLowerCase()) ? (
                 <Popconfirm
                   title='请选择图片规格'
                   onConfirm={() => downFileFu(item.filePath)}

+ 4 - 3
src/pages/Y_goodsDetails/Y1cathet/Y33com.tsx

@@ -81,11 +81,11 @@ function Y33com({ isLook, sId }: Props) {
           const fileNameArr = item.fileName.split('.')
           const fileNameLast = fileNameArr[fileNameArr.length - 1]
 
-          return fileImgArr.includes(fileNameLast) ? (
+          return fileImgArr.includes(fileNameLast.toLowerCase()) ? (
             <div className='tableImgAuto'>
               <ImageLazy width={60} height={60} srcBig={item.filePath} src={item.thumb} />
             </div>
-          ) : fileVideoArr.includes(fileNameLast) ? (
+          ) : fileVideoArr.includes(fileNameLast.toLowerCase()) ? (
             <YtableVideo src={item.filePath} />
           ) : (
             ' - '
@@ -127,7 +127,8 @@ function Y33com({ isLook, sId }: Props) {
           const fileNameLast = fileNameArr[fileNameArr.length - 1]
           return (
             <>
-              {downImg['图片'] === '原图和缩略图' && fileImgArr.includes(fileNameLast) ? (
+              {downImg['图片'] === '原图和缩略图' &&
+              fileImgArr.includes(fileNameLast.toLowerCase()) ? (
                 <Popconfirm
                   title='请选择图片规格'
                   onConfirm={() => downFileFu(item.filePath)}

+ 6 - 6
src/pages/Z_system/Z1dict/index.tsx

@@ -22,12 +22,12 @@ const noIdArr = [
   '12561',
   '12635',
   '12535',
-  '12568',
-  '12569',
-  '12572',
-  '12573',
-  '12574',
-  '12577',
+  // '12568',
+  // '12569',
+  // '12572',
+  // '12573',
+  // '12574',
+  // '12577',
   '12545',
   '12500'
 ]