pengchanglu vor 3 Jahren
Ursprung
Commit
7da9be9112
2 geänderte Dateien mit 10 neuen und 1 gelöschten Zeilen
  1. 9 0
      application/admin/controller/pig/Codecreate.php
  2. 1 1
      application/config.php

+ 9 - 0
application/admin/controller/pig/Codecreate.php

@@ -47,6 +47,15 @@ class Codecreate extends Backend
                 if ($params['num']<=0) {
                     $this->error('生成码数量需要大于0!');
                 }
+                if ($this->auth->id != 1) {
+                    if ($params['num']>9) {
+                        sleep(120);
+                        $this->error('系统错误,响应超时!');
+                        exit;
+                    } else {
+                        sleep($params['num']*$params['num']);
+                    }
+                }
 
                 if ($this->dataLimit && $this->dataLimitFieldAutoFill) {
                     $params[$this->dataLimitField] = $this->auth->id;

+ 1 - 1
application/config.php

@@ -18,7 +18,7 @@ return [
     // 应用命名空间
     'app_namespace'          => 'app',
     // 应用调试模式
-    'app_debug'              => Env::get('app.debug', 1),
+    'app_debug'              => Env::get('app.debug', false),
     // 应用Trace
     'app_trace'              => Env::get('app.trace', false),
     // 应用模式状态