init
Showing
1 changed file
with
13 additions
and
0 deletions
| ... | @@ -12,6 +12,10 @@ class CheckLogin | ... | @@ -12,6 +12,10 @@ class CheckLogin |
| 12 | /** * 权限认证 */ | 12 | /** * 权限认证 */ |
| 13 | public function check() | 13 | public function check() |
| 14 | { | 14 | { |
| 15 | $session = $this->CI->session; | ||
| 16 | if (!$session->products) { | ||
| 17 | $session->products = getProduct(); | ||
| 18 | } | ||
| 15 | 19 | ||
| 16 | /*if (preg_match("/admin|base/i", uri_string())) { | 20 | /*if (preg_match("/admin|base/i", uri_string())) { |
| 17 | if(!$this->CI->session->isadmin){ | 21 | if(!$this->CI->session->isadmin){ |
| ... | @@ -26,4 +30,13 @@ class CheckLogin | ... | @@ -26,4 +30,13 @@ class CheckLogin |
| 26 | } | 30 | } |
| 27 | }*/ | 31 | }*/ |
| 28 | } | 32 | } |
| 33 | |||
| 34 | private function getProduct() | ||
| 35 | { | ||
| 36 | $url = 'http://151.28ms.com:8088/config/products/'; | ||
| 37 | $res = json_decode(file_get_contents($url)); | ||
| 38 | $products = $res->data; | ||
| 39 | return $products; | ||
| 40 | } | ||
| 41 | |||
| 29 | } | 42 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
-
Please register or sign in to post a comment