Esempio n. 1
0
 public function loginAction($username = null, $password = null, $verifycode = null)
 {
     // if(!check_verify($verifycode)){
     //          $this->error('验证码输入错误!');
     //       }
     $sysUserService = new SysUserService();
     $user = $sysUserService->login($username, $password);
     if (0 < $user['id']) {
         //UC登录成功
         loginSession($user);
         $this->success('登录成功!', U('Admin/Brand/index'));
     } else {
         //登录失败
         switch ($user['id']) {
             case -1:
                 $error = '用户不存在或被禁用!';
                 break;
                 //系统级别禁用
             //系统级别禁用
             case -2:
                 $error = '密码错误!';
                 break;
             default:
                 $error = '未知错误!';
                 break;
                 // 0-接口参数错误(调试阶段使用)
         }
         $this->error($error);
     }
 }
Esempio n. 2
0
 public function changepwAction($original_password, $new_password, $confirm_password)
 {
     $sysUserService = new SysUserService();
     $id = getLoginAdminUid();
     $ret = $sysUserService->changePassword($id, $original_password, $new_password, $confirm_password);
     if ($ret === true) {
         $this->success('密码修改成功!', U('Admin/Brand/index'));
     } else {
         $this->error($ret);
     }
 }