Jelajahi Sumber

将用户相关表加入到受保护列表中。

F4nniu 3 tahun lalu
induk
melakukan
e5235a4991
1 mengubah file dengan 7 tambahan dan 6 penghapusan
  1. 7 6
      application/admin/command/Crud.php

+ 7 - 6
application/admin/command/Crud.php

@@ -23,11 +23,12 @@ class Crud extends Command
     ];
 
     /**
-     * 受保护的系统表,crud不会生效
+     * 受保护的系统表, crud不会生效
      */
-    protected $systemTable = [
-       'admin','admin_log','auth_group','auth_group_access','auth_rule', 
-       'attachment', 'config','category'
+    protected $systemTables = [
+       'admin', 'admin_log', 'auth_group', 'auth_group_access', 'auth_rule', 
+       'attachment', 'config', 'category', 'ems', 'sms',
+       'user', 'user_group', 'user_rule', 'user_score_log', 'user_token',
     ];
 
     /**
@@ -311,8 +312,8 @@ class Crud extends Command
         $prefix = Config::get($db . '.prefix');
 
         //系统表无法生成,防止后台错乱
-        if(in_array(str_replace($prefix,"",$table),$this->systemTable)){
-            throw new Exception('system table name can\'t crud');
+        if(in_array(str_replace($prefix,"",$table),$this->systemTables)){
+            throw new Exception('system table can\'t be crud');
         }
 
         //模块