public function manage() { if (IS_POST) { if (isset($_POST['login'])) { // login $smsClient = new SmsClient(); $stats = $smsClient->login(); if ($stats !== null && $stats !== false && $stats == 0) { $this->success('登录成功!', U('Sms/index')); } else { echo '登录失败。错误码:' . $stats; //$this->error('登录失败!'.$stats, U('Sms/index')); } } else { if ($_POST['logout']) { // logout $smsClient = new SmsClient(); $stats = $smsClient->logout(); if ($stats !== null && $stats !== false && $stats == 0) { $this->success('注销成功!', U('Sms/index')); } else { echo '注销失败。错误码:' . $stats; //$this->error('注销失败!'.$stats, U('Sms/index')); } } } } }