qwj
2023-08-28 f99c1becb0bbde82796e15d27e11ac4965c56468
DocumentServiceAPI.Application/UserAndLogin/LogInController.cs
@@ -1,5 +1,7 @@
using DocumentServiceAPI.Application.UserAndLogin.Services;
using DocumentServiceAPI.Application.UserAndLogin.ViewMode;
using DocumentServiceAPI.Model.cyDocumentModel;
using DocumentServiceAPI.Model.UserInfoModel;
using DocumentServiceAPI.Utility;
using Furion.DynamicApiController;
using Furion.JsonSerialization;
@@ -58,7 +60,7 @@
                    throw Oops.Oh("登录信息出错");
                if(Parma.ITCode!= itcode)
                    throw Oops.Oh("用户名错误");
                IsTokenPass=true;
            }
@@ -74,7 +76,7 @@
                        case 0:
                            throw Oops.Oh($"账户或者密码错误");
                        case 1:
                        if (!needtoken)
                        if (!IsTokenPass)
                        {
                            needtoken = await _userService.CheckPsw(Tender[0].TenderId, Tender[0].EmployeeID, Parma.PassWord);
@@ -193,34 +195,33 @@
        }
        /// <summary>
        /// 获取公司列表
        /// 是否是用户租户,或者是员工
        /// </summary>
        /// <returns>登录信息</returns>
        public bool GetUnitList()
        /// <param name="ITCode">账号</param>
        /// <returns>  返回true 代表是, false代表不是</returns>
        [HttpGet("IDIsEmployee")]
        public async Task<bool> IDIsEmployee(string ITCode, [FromServices] ISqlSugarClient db)
        {
          var ad=  ITCode.TryValidate(ValidationTypes.PhoneNumber);
            if(!ad.IsValid)
            {
                throw Oops.Oh("请输入正确的账号");
            }
          var count= await db.Queryable<TenantInfo>().Where(x=>x.ItCode==ITCode&&x.IsEn==true&&x.IsDel==false).WithCache(600).CountAsync();
            if (count > 0)
                return true;
            count=await db.Queryable<Document_EmployeeInfo>().Where(x=>x.UserName==ITCode).WithCache(600).CountAsync();
            if (count > 0)
                return true;
            return false;
            return true;
        }
        /// <summary>
        /// 获取公司列表
        /// </summary>
        /// <returns>登录信息</returns>
        public bool GetTenantInfoList()
        {
            return true;
        }
        public string Get()
        {
            return $"Hello {nameof(Furion)}";
        }
    }
}