|
|
@ -10,8 +10,6 @@ include_once(SERVER_ROOT . "/model/mPage.php"); |
|
|
|
class index extends publicBase { |
|
|
|
|
|
|
|
private function _check_login() { |
|
|
|
return array('uid' => $this->post('uid')); |
|
|
|
|
|
|
|
$uid = $this->post('uid'); |
|
|
|
$token = $this->post('token'); |
|
|
|
if ($uid < 0 || !$token) $this->ajax_json(false, '参数错误', array('code' => CODE_LOGIN_EXIPRE)); |
|
|
@ -28,7 +26,6 @@ class index extends publicBase { |
|
|
|
} |
|
|
|
|
|
|
|
public function login() { |
|
|
|
|
|
|
|
$name = trim($this->get('name')); |
|
|
|
$password = trim($this->get('password')); |
|
|
|
|
|
|
@ -44,29 +41,25 @@ class index extends publicBase { |
|
|
|
} |
|
|
|
|
|
|
|
public function home() { |
|
|
|
$mformula = new mFormula(); |
|
|
|
$robj = $mformula->initRedis(); |
|
|
|
$user_info = $robj->get(_QR_ADMIN_LOGIN_USER_INFO); |
|
|
|
$user_info = json_decode($user_info, true); |
|
|
|
if (empty($user_info)) header('Location: /index/login'); |
|
|
|
if ($_COOKIE['uid'] !== 0 && empty($_COOKIE['token'])) header('Location: /index/login'); |
|
|
|
|
|
|
|
$this->view['uid'] = $user_info['uid']; |
|
|
|
$this->view['token'] = $user_info['token']; |
|
|
|
$this->view['uid'] = $_COOKIE['uid']; |
|
|
|
$this->view['token'] = $_COOKIE['token']; |
|
|
|
|
|
|
|
$is_all = $this->get('is_all') + 0; |
|
|
|
$name = trim($this->get('name')); |
|
|
|
|
|
|
|
$condition = array(); |
|
|
|
$url = "/index/home"; |
|
|
|
$url = "/index/home/is_all/{$is_all}"; |
|
|
|
if ($name) { |
|
|
|
$condition['name'] = $name; |
|
|
|
$url .= "/name/{$name}"; |
|
|
|
} |
|
|
|
if (!$is_all) { |
|
|
|
$condition['uid'] = 0; |
|
|
|
$url .= "/is_all/{$is_all}"; |
|
|
|
} |
|
|
|
|
|
|
|
$mformula = new mFormula(); |
|
|
|
$total = $mformula->getFormulaTotal($condition); |
|
|
|
|
|
|
|
// 分页 |
|
|
@ -89,14 +82,10 @@ class index extends publicBase { |
|
|
|
} |
|
|
|
|
|
|
|
public function formula_add() { |
|
|
|
$mformula = new mFormula(); |
|
|
|
$robj = $mformula->initRedis(); |
|
|
|
$user_info = $robj->get(_QR_ADMIN_LOGIN_USER_INFO); |
|
|
|
$user_info = json_decode($user_info, true); |
|
|
|
if (empty($user_info)) header('Location: /index/login'); |
|
|
|
if ($_COOKIE['uid'] !== 0 && empty($_COOKIE['token'])) header('Location: /index/login'); |
|
|
|
|
|
|
|
$this->view['uid'] = $user_info['uid']; |
|
|
|
$this->view['token'] = $user_info['token']; |
|
|
|
$this->view['uid'] = $_COOKIE['uid']; |
|
|
|
$this->view['token'] = $_COOKIE['token']; |
|
|
|
|
|
|
|
$id = $this->get('id'); |
|
|
|
if ($id) { |
|
|
|