wzh 5 anos atrás
pai
commit
3fb63d2dd9
1 arquivos alterados com 4 adições e 20 exclusões
  1. 4 20
      api/application/controllers/Common.php

+ 4 - 20
api/application/controllers/Common.php

@@ -49,21 +49,9 @@ class Common extends CI_Controller {
 
         $type = intval($this->input->post("fileType",true));
 
-        if ($type == 0) {
-            $path = '../upload/image';
-            $config['file_name'] = md5(uniqid());   // 设置图片名字
-        }else{
-            $config['overwrite'] = true;
-            $filename = trim($_FILES['file']['name']);
-            if (strpos($filename, 'LampControl_') !== false) {
-                $path = '../upload/firewalld';
-                $config['file_name'] = $filename;
-            }else{
-                $path = '../upload/firewalld';
-                $config['file_name'] = 'openwrt-'.md5(uniqid());
-            }
-            
-        }
+        $path = '../upload/image';
+        $config['file_name'] = md5(uniqid());   // 设置图片名字
+       
         if (!file_exists($path)) {
             mkdir($path);
         }
@@ -88,11 +76,7 @@ class Common extends CI_Controller {
         {
             $data = $this->upload->data();
 
-            if ($type == 0) {
-                $imagePath = '/upload/image/'.$data['file_name'];
-            }else{
-                $imagePath = '/upload/firewalld/'.$data['file_name'];
-            }
+            $imagePath = '/upload/image/'.$data['file_name'];
             
             exit(json_result('0000',$this->response['0000'],array('path'=>base_url($imagePath))));
         }