Exemplo n.º 1
0
        public ResponseResult <User> ValidAndGet(string account, string password)
        {
            var user = WcfHelper.Using <ISsoService, User>(c => { return(c.ValidAndGet(account, password)); });

            if (user == null)
            {
                return(new ResponseResult <User>()
                {
                    Code = 2,
                    Msg = "用户名或密码不正确!"
                });
            }

            TokenManager tokenMng = new TokenManager();
            var          token    = tokenMng.Add(user);

            return(new ResponseResult <User>()
            {
                Code = 1,
                Tag = token
            });
        }
Exemplo n.º 2
0
 public User GetUser(string account)
 {
     return(WcfHelper.Using <ISsoService, User>(c => { return c.GetUser(account); }));
 }