diff --git a/module/admin/control.php b/module/admin/control.php index 79fde242b1..fa98d2f0fb 100755 --- a/module/admin/control.php +++ b/module/admin/control.php @@ -547,11 +547,13 @@ class admin extends control $this->config->admin->register->bindCommunityMobile = $data->mobile; $agreeUX = $data->agreeUX; - $agreeUX = $agreeUX == 1 ? 'true' : 'false'; + $agreeUX = $agreeUX == 'on' ? 'true' : 'false'; $this->loadModel('setting')->setItem('system.admin.register.agreeUX', $agreeUX); $this->config->admin->agreeUX = $agreeUX; - return $this->send(array('result' => 'success', 'message' => $this->lang->admin->community->joinSuccess, 'callback' => 'loadToRegister()')); + $callBack = $this->loadModel('user')->isLogon() ? 'loadToRegister()' : 'loadToIndex()'; + + return $this->send(array('result' => 'success', 'message' => $this->lang->admin->community->joinSuccess, 'callback' => $callBack)); } return $this->send(array('result' => 'fail', 'message' => isset($response['message']) ? $response['message'] : $this->lang->admin->community->loginFailed)); } diff --git a/module/admin/js/register.ui.js b/module/admin/js/register.ui.js index 8314a9cc66..28fb2d5f10 100644 --- a/module/admin/js/register.ui.js +++ b/module/admin/js/register.ui.js @@ -84,4 +84,11 @@ window.loadToRegister = function() setTimeout(function() { location.href = $.createLink('admin', 'register'); }, 2000); +} + +window.loadToIndex = function() +{ + setTimeout(function() { + location.href = $.createLink('index', 'index'); + }, 2000); } \ No newline at end of file