public function checkVerifyKey($phone, $key)
 {
     if (checkVerifyKey($phone . $key)) {
         echo "OK";
     } else {
         echo "FAILED!";
     }
 }
 public function register()
 {
     if (IS_POST) {
         $phone = $_POST['userphone'];
         $key = $_POST['verifyCode'];
         $password = $_POST['password'];
         $username = $_POST['username'];
         $province = $_POST['province'];
         $city = $_POST['city'];
         $addrdetail = $_POST['addrdetail'];
         if (checkVerifyKey($phone . $key)) {
             echo "OK";
             if ($this->addUser($phone, $password, $_POST)) {
                 echo "注册成功,请<a href='" . U("Home/Login/login") . "'>登录</a>";
             }
             // $this->logout();  //用户首页,前台
         } else {
             echo "验证码错误!";
         }
         // $this->error("暂不支持注册!",U("Home/login/index"));
     } else {
         $this->assign("titlename", "超威电池管理系统-注册新用户");
         $this->assign("postUrl", U("Home/Login/register"));
         $this->assign('cities', $this->getCities("湖南省"));
         $this->assign('provinces', $this->getProvinces());
         $this->display('register');
     }
 }