Esempio n. 1
0
        public void VerifyUserSystemType(string userId, string systemType)
        {
            var userClientTypes = _userClientTypeQueryService.GetUserSystemTypes(userId);

            if (LotteryConstants.BackOfficeKey.Equals(systemType, StringComparison.CurrentCultureIgnoreCase))
            {
                if (!userClientTypes.Safe().Any(p => p.SystemType == SystemType.BackOffice && p.Status == 0))
                {
                    throw new LotteryAuthorizeException("该账号未被授权" + SystemType.BackOffice.GetChineseDescribe());
                }
            }
            else if (LotteryConstants.OfficialWebsite.Equals(systemType, StringComparison.CurrentCultureIgnoreCase))
            {
                // do nothing
            }
            else
            {
                if (userClientTypes.Safe().Any())
                {
                    if (!userClientTypes.Safe().Any(p => p.SystemType == SystemType.App && p.Status == 0))
                    {
                        throw new LotteryAuthorizeException("该账号未被授权访问" + SystemType.App.GetChineseDescribe());
                    }
                }
            }
        }