示例#1
0
        public BaseResponse LoginIn([FromBody] VmAuthUser authUser)
        {
            try
            {
                //var headToken = Request.Headers;

                //var token = headToken["token"];
                //CheckJwtToken(token);

                if (authUser.password == "123456")
                {
                    var result = new Rsp_Auth_User();
                    result.user  = domainService.GetSysUserByName(authUser.username);
                    result.token = GetJwtToken(authUser.username);
                    return(ApiSuccessResult(result));
                }
                else
                {
                    return(ApiError401("账号密码错误,请重新输入"));
                }
            }
            catch (Exception ex)
            {
                _Log4Net.Error("LoginIn--异常信息", ex);
                return(ApiErrorResult(ex.Message));
            }
        }
示例#2
0
        public Rsp_Auth_User Login([FromBody] VmAuthUser authUser)
        {
            // 密码解密

            // 查询验证码

            // 清除验证码

            // 生成令牌

            // 保存在线信息

            // 返回 token 与 用户信息
            var result = new Rsp_Auth_User();

            result.token = Guid.NewGuid().ToString();

            return(result);
        }
示例#3
0
 public BaseResponse CheckUserAccount([FromBody] VmAuthUser authUser)
 {
     try
     {
         if (authUser.password == "123456")
         {
             var result = new Rsp_Auth_User();
             result.user  = domainService.GetSysUserByName(authUser.username);
             result.token = GetJwtToken(authUser.username);
             return(ApiSuccessResult(result));
         }
         else
         {
             return(ApiError401("账号密码错误,请重新输入"));
         }
     }
     catch (Exception ex)
     {
         _Log4Net.Error("CheckUserAccount--异常信息", ex);
         return(ApiErrorResult(ex.Message));
     }
 }