コード例 #1
0
        public ActionResult <WeChatLoginResModel> Manage_WeChatLogin_User123123(WeChatLoginViewModel weChatLoginViewModel)
        {
            WeChatLoginResModel weChatLoginResModel = new WeChatLoginResModel();
            var UserSearchResult = _loginService.WeChatLogin_User(weChatLoginViewModel);

            if (UserSearchResult == null)
            {
                weChatLoginResModel.IsSuccess                  = false;
                weChatLoginResModel.baseViewModel.Message      = "用户名不存在或者密码错误";
                weChatLoginResModel.baseViewModel.ResponseCode = 400;
                _ILogger.Information("用户名不存在或者密码错误,进入系统失败");
                return(BadRequest(weChatLoginResModel));
            }
            else
            {
                weChatLoginResModel.user_session               = UserSearchResult;
                weChatLoginResModel.IsSuccess                  = true;
                weChatLoginResModel.baseViewModel.Message      = "存在该用户,查询成功";
                weChatLoginResModel.baseViewModel.ResponseCode = 200;

                TokenModelJwt tokenModel = new TokenModelJwt();
                tokenModel.Uid  = 2;
                tokenModel.Role = "Admin";
                string token = JwtHelper.IssueJwt(tokenModel);


                _ILogger.Information("查询用户信息,存在该用户,权限查询成功");

                return(Ok(weChatLoginResModel));
            }
        }
コード例 #2
0
        public ActionResult <WeChatLoginResModel> Manage_XuXuLogin_User(WeChatLoginViewModel weChatLoginViewModel)
        {
            WeChatLoginResModel weChatLoginResModel = new WeChatLoginResModel();
            var UserSearchResult = _loginService.WeChatLogin_User(weChatLoginViewModel);

            if (UserSearchResult == null)
            {
                weChatLoginResModel.IsSuccess                  = false;
                weChatLoginResModel.baseViewModel.Message      = "用户名不存在或者密码错误";
                weChatLoginResModel.baseViewModel.ResponseCode = 400;
                //_ILogger.Information("用户名不存在或者密码错误,进入系统失败");
                return(BadRequest(weChatLoginResModel));
            }
            else
            {
                weChatLoginResModel.user_session               = UserSearchResult;
                weChatLoginResModel.IsSuccess                  = true;
                weChatLoginResModel.baseViewModel.Message      = "存在该用户,查询成功";
                weChatLoginResModel.baseViewModel.ResponseCode = 200;
                weChatLoginResModel.tokenViewModel.code        = "200";
                weChatLoginResModel.tokenViewModel.data        = "2728b712288da12fffd103af3bd616ff";

                //_ILogger.Information("查询用户信息,存在该用户,权限查询成功");


                return(Ok(weChatLoginResModel));
            }
        }
コード例 #3
0
        public ActionResult <WeChatLoginResModel> Manage_XuXuLogin_User(WeChatLoginViewModel weChatLoginViewModel)
        {
            WeChatLoginResModel weChatLoginResModel = new WeChatLoginResModel();
            var    UserSearchResult = _loginService.WeChatLogin_User(weChatLoginViewModel);
            string jwtStr           = string.Empty;

            if (UserSearchResult == null)
            {
                weChatLoginResModel.IsSuccess                  = false;
                weChatLoginResModel.baseViewModel.Message      = "用户名不存在或者密码错误";
                weChatLoginResModel.baseViewModel.ResponseCode = 400;
                _ILogger.Information("用户名不存在或者密码错误,进入系统失败");
                return(Ok(weChatLoginResModel));
            }
            else
            {
                TokenModelJwt tokenModel = new TokenModelJwt();
                tokenModel.Uid  = 2;
                tokenModel.Role = "Admin";
                jwtStr          = JwtHelper.IssueJwt(tokenModel);
                weChatLoginResModel.tokenViewModel.data        = jwtStr;//token
                weChatLoginResModel.user_session               = UserSearchResult;
                weChatLoginResModel.IsSuccess                  = true;
                weChatLoginResModel.baseViewModel.Message      = "存在该用户,查询成功";
                weChatLoginResModel.baseViewModel.ResponseCode = 200;
                //  weChatLoginResModel.tokenViewModel.code ="200";
                //  weChatLoginResModel.tokenViewModel.data  = "2728b712288da12fffd103af3bd616ff" ;

                _ILogger.Information("查询用户信息,存在该用户,权限查询成功");


                return(Ok(weChatLoginResModel));
            }
        }
コード例 #4
0
        public ActionResult <WeChatLoginResModel> Manage_User_UpdatePassword(WeChatUpdateViewModel weChatUpdateViewModel)
        {
            WeChatLoginResModel weChatLoginResModel = new WeChatLoginResModel();
            var UserSearchResult = _loginService.WeChatLogin_User_Update(weChatUpdateViewModel);

            if (UserSearchResult == 0)
            {
                weChatLoginResModel.IsSuccess                  = false;
                weChatLoginResModel.baseViewModel.Message      = "用户名不存在或者密码错误";
                weChatLoginResModel.baseViewModel.ResponseCode = 200;
                _ILogger.Information("用户名不存在或者密码错误,修改密码失败");
                return(Ok(weChatLoginResModel));
            }
            else
            {
                weChatLoginResModel.IsSuccess                  = true;
                weChatLoginResModel.baseViewModel.Message      = "存在该用户,修改密码成功";
                weChatLoginResModel.baseViewModel.ResponseCode = 200;
                _ILogger.Information("查询用户信息,存在该用户,修改密码成功");
                return(Ok(weChatLoginResModel));
            }
        }