Преглед изворни кода

优化上传图片后缀兼容大写字母

evoxwht пре 2 година
родитељ
комит
5e1cb83a4e

+ 1 - 1
crmeb/crmeb/services/upload/storage/Cos.php

@@ -139,7 +139,7 @@ class Cos extends BaseUpload
                 return $this->setError('上传的文件不存在');
             }
             if ($this->validate) {
-                if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
+                if (!in_array(strtolower(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION)), $this->validate['fileExt'])) {
                     return $this->setError('不合法的文件后缀');
                 }
                 if (filesize($fileHandle) > $this->validate['filesize']) {

+ 1 - 1
crmeb/crmeb/services/upload/storage/Jdoss.php

@@ -129,7 +129,7 @@ class Jdoss extends BaseUpload
             return $this->setError('上传的文件不存在');
         }
         if ($this->validate) {
-            if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
+            if (!in_array(strtolower(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION)), $this->validate['fileExt'])) {
                 return $this->setError('不合法的文件后缀');
             }
             if (filesize($fileHandle) > $this->validate['filesize']) {

+ 1 - 1
crmeb/crmeb/services/upload/storage/Local.php

@@ -116,7 +116,7 @@ class Local extends BaseUpload
             return $this->setError('上传的文件不存在');
         }
         if ($this->validate) {
-            if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
+            if (!in_array(strtolower(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION)), $this->validate['fileExt'])) {
                 return $this->setError('不合法的文件后缀');
             }
             if (filesize($fileHandle) > $this->validate['filesize']) {

+ 1 - 1
crmeb/crmeb/services/upload/storage/Obs.php

@@ -59,7 +59,7 @@ class Obs extends BaseUpload
                 return $this->setError('上传的文件不存在');
             }
             if ($this->validate) {
-                if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
+                if (!in_array(strtolower(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION)), $this->validate['fileExt'])) {
                     return $this->setError('不合法的文件后缀');
                 }
                 if (filesize($fileHandle) > $this->validate['filesize']) {

+ 1 - 1
crmeb/crmeb/services/upload/storage/Oss.php

@@ -130,7 +130,7 @@ class Oss extends BaseUpload
             return $this->setError('上传的文件不存在');
         }
         if ($this->validate) {
-            if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
+            if (!in_array(strtolower(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION)), $this->validate['fileExt'])) {
                 return $this->setError('不合法的文件后缀');
             }
             if (filesize($fileHandle) > $this->validate['filesize']) {

+ 1 - 1
crmeb/crmeb/services/upload/storage/Qiniu.php

@@ -126,7 +126,7 @@ class Qiniu extends BaseUpload
             return $this->setError('上传的文件不存在');
         }
         if ($this->validate) {
-            if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
+            if (!in_array(strtolower(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION)), $this->validate['fileExt'])) {
                 return $this->setError('不合法的文件后缀');
             }
             if (filesize($fileHandle) > $this->validate['filesize']) {

+ 1 - 1
crmeb/crmeb/services/upload/storage/Tyoss.php

@@ -58,7 +58,7 @@ class Tyoss extends BaseUpload
                 return $this->setError('上传的文件不存在');
             }
             if ($this->validate) {
-                if (!in_array(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION), $this->validate['fileExt'])) {
+                if (!in_array(strtolower(pathinfo($fileHandle->getOriginalName(), PATHINFO_EXTENSION)), $this->validate['fileExt'])) {
                     return $this->setError('不合法的文件后缀');
                 }
                 if (filesize($fileHandle) > $this->validate['filesize']) {

+ 1 - 1
template/admin/src/pages/notify/smsConfig/index.vue

@@ -137,7 +137,7 @@ export default {
     };
   },
   created() {
-    this.onIsLogin();
+    // this.onIsLogin();
   },
   methods: {
     onChangePhone() {