Exemple #1
0
        public FunctionResult <JobToken> MobileLogin(string mobile, string code)
        {
            var       r    = new FunctionResult <JobToken>();
            LoginInfo data = LoginDal.MobileLogin(mobile, code);

            if (data != null)
            {
                var jobToken = new JobToken()
                {
                    JobId  = GetJobId(data.UserId),
                    UserId = data.UserId,
                    Token  = GetToken()
                };
                if (JobTokenDal.Add(jobToken) > 0)
                {
                    r.Data = jobToken;
                }
                else
                {
                    r.ErrorMsg = "无法获取标识";
                }
            }
            else
            {
                r.ErrorMsg = "无匹配用户登陆信息";
            }
            return(r);
        }
Exemple #2
0
        public FunctionResult <JobToken> Login(string loginKey, string pwd)
        {
            var r = new FunctionResult <JobToken>();

            pwd = Encryption(pwd);
            LoginInfo data = LoginDal.Login(loginKey, pwd);

            if (data != null)
            {
                var jobToken = new JobToken()
                {
                    JobId  = GetJobId(data.UserId),
                    UserId = data.UserId,
                    Token  = GetToken()
                };
                if (JobTokenDal.Add(jobToken) > 0)
                {
                    r.Data = jobToken;
                    RedisService.Set <JobToken>(DefineTable.CacheName, String.Format(JobAuthorityCacheKey.AuthorityCacheKey, jobToken.Token), jobToken);
                }
                else
                {
                    r.ErrorMsg = "无法获取标识";
                }
            }
            else
            {
                r.ErrorMsg = "无匹配用户登陆信息";
            }
            return(r);
        }
Exemple #3
0
        public FunctionResult <JobToken> Create(JobToken info)
        {
            var r = new FunctionResult <JobToken>(); int id = JobTokenDal.Add(info); if (id > 0)

            {
                r.Data = info; r.Data.JobTokenId = id;
            }

            return(r);
        }
Exemple #4
0
 public GridPager <JobToken> GetPager(GridPagerPamater <JobTokenSearchPamater> searchParam)
 {
     var r = JobTokenDal.GetGridPager(searchParam); return(r);
 }
Exemple #5
0
 public FunctionListResult <JobToken> GetList(JobTokenSearchPamater pamater)
 {
     var r = new FunctionListResult <JobToken>(); r.Data = JobTokenDal.GetList(pamater); return(r);
 }
Exemple #6
0
 public FunctionResult <JobToken> Get(int Id)
 {
     var r = new FunctionResult <JobToken>(); r.Data = JobTokenDal.Get(Id); return(r);
 }
Exemple #7
0
 public FunctionOpenResult <bool> DeleteByID(List <int> idList)
 {
     var r = new FunctionOpenResult <bool>(); r.Data = JobTokenDal.Delete(idList); return(r);
 }
Exemple #8
0
 public FunctionOpenResult <bool> UpdateByID(JobToken info)
 {
     var r = new FunctionOpenResult <bool>(); r.Data = JobTokenDal.Update(info) > 0; return(r);
 }