Browse Source

chore: 😀去掉GoView登录接口租户id必填验证,增加默认租户id为默认值

喵你个旺呀 1 year ago
parent
commit
20c49633b1

+ 0 - 1
Admin.NET/Plugins/Admin.NET.Plugin.GoView/Service/GoViewSys/Dto/GoViewLoginInput.cs

@@ -26,6 +26,5 @@ public class GoViewLoginInput
     /// <summary>
     /// <summary>
     /// 租户
     /// 租户
     /// </summary>
     /// </summary>
-    [Required(ErrorMessage = "租户不能为空")]
     public long? TenantId { get; set; }
     public long? TenantId { get; set; }
 }
 }

+ 3 - 0
Admin.NET/Plugins/Admin.NET.Plugin.GoView/Service/GoViewSys/GoViewSysService.cs

@@ -35,6 +35,9 @@ public class GoViewSysService : IDynamicApiController
     [DisplayName("GoView 登录")]
     [DisplayName("GoView 登录")]
     public async Task<GoViewLoginOutput> Login(GoViewLoginInput input)
     public async Task<GoViewLoginOutput> Login(GoViewLoginInput input)
     {
     {
+        // 设置默认租户
+        input.TenantId ??= SqlSugarConst.DefaultTenantId;
+
         _sysCacheService.Set($"{CacheConst.KeyConfig}{ConfigConst.SysCaptcha}", false);
         _sysCacheService.Set($"{CacheConst.KeyConfig}{ConfigConst.SysCaptcha}", false);
 
 
         input.Password = CryptogramUtil.SM2Encrypt(input.Password);
         input.Password = CryptogramUtil.SM2Encrypt(input.Password);