dever 3 years ago
parent
commit
ac903b8bd0
2 changed files with 29 additions and 9 deletions
  1. 14 4
      app/factory/admin/Core.php
  2. 15 5
      app/store/admin/Core.php

+ 14 - 4
app/factory/admin/Core.php

@@ -19,24 +19,34 @@ class Core
             if (!in_array(2, $role)) {
             if (!in_array(2, $role)) {
             	unset($this->user['msg_type'][1]);
             	unset($this->user['msg_type'][1]);
             	if (strstr($uri, 'order')) {
             	if (strstr($uri, 'order')) {
-            		Dever::alert('您没有权限');
+            		echo '您没有权限';die;
             	}
             	}
             }
             }
             if (!in_array(4, $role)) {
             if (!in_array(4, $role)) {
             	unset($this->user['msg_type'][2]);
             	unset($this->user['msg_type'][2]);
                 if (strstr($uri, 'stat')) {
                 if (strstr($uri, 'stat')) {
-            		Dever::alert('您没有权限');
+            		echo '您没有权限';die;
             	}
             	}
             }
             }
 
 
             if (strstr($uri, 'set')) {
             if (strstr($uri, 'set')) {
-            	Dever::alert('您没有权限');
+            	echo '您没有权限';die;
             }
             }
             if (strstr($uri, 'user')) {
             if (strstr($uri, 'user')) {
-            	Dever::alert('您没有权限');
+            	echo '您没有权限';die;
             }
             }
 
 
             $this->user['msg_type'] = implode(',', $this->user['msg_type']);
             $this->user['msg_type'] = implode(',', $this->user['msg_type']);
         }
         }
+
+        $this->info = Dever::db('factory/info')->find($this->id);
+        if (!$this->info) {
+            echo '工厂不存在';die;
+        }
+        if ($this->info['status'] != 1) {
+            if (!strstr($uri, 'set') && !strstr($uri, 'help') && !strstr($uri, 'console')) {
+                echo '认证中或者认证失败无法访问该功能';die;
+            }
+        }
     }
     }
 }
 }

+ 15 - 5
app/store/admin/Core.php

@@ -19,31 +19,41 @@ class Core
             if (!in_array(2, $role)) {
             if (!in_array(2, $role)) {
             	unset($this->user['msg_type'][1]);
             	unset($this->user['msg_type'][1]);
             	if ($uri == 'order' || strstr($uri, 'admin/order') || strstr($uri, 'order_')) {
             	if ($uri == 'order' || strstr($uri, 'admin/order') || strstr($uri, 'order_')) {
-            		Dever::alert('您没有权限');
+            		echo '您没有权限';die;
             	}
             	}
             }
             }
             if (!in_array(4, $role)) {
             if (!in_array(4, $role)) {
             	unset($this->user['msg_type'][2]);
             	unset($this->user['msg_type'][2]);
                 if (strstr($uri, 'stat')) {
                 if (strstr($uri, 'stat')) {
-            		Dever::alert('您没有权限');
+            		echo '您没有权限';die;
             	}
             	}
             }
             }
 
 
             if (!in_array(3, $role)) {
             if (!in_array(3, $role)) {
             	unset($this->user['msg_type'][3]);
             	unset($this->user['msg_type'][3]);
                 if (strstr($uri, 'factory_order') || strstr($uri, 'goods') || strstr($uri, 'out')) {
                 if (strstr($uri, 'factory_order') || strstr($uri, 'goods') || strstr($uri, 'out')) {
-            		Dever::alert('您没有权限');
+            		echo '您没有权限';die;
             	}
             	}
             }
             }
 
 
             if (strstr($uri, 'set')) {
             if (strstr($uri, 'set')) {
-            	Dever::alert('您没有权限');
+            	echo '您没有权限';die;
             }
             }
             if (strstr($uri, 'user')) {
             if (strstr($uri, 'user')) {
-            	Dever::alert('您没有权限');
+            	echo '您没有权限';die;
             }
             }
 
 
             $this->user['msg_type'] = implode(',', $this->user['msg_type']);
             $this->user['msg_type'] = implode(',', $this->user['msg_type']);
         }
         }
+
+        $this->info = Dever::db('store/info')->find($this->id);
+        if (!$this->info) {
+            echo '仓库不存在';die;
+        }
+        if ($this->info['status'] != 1) {
+            if (!strstr($uri, 'set') && !strstr($uri, 'help') && !strstr($uri, 'console')) {
+                echo '认证中或者认证失败无法访问该功能';die;
+            }
+        }
     }
     }
 }
 }