瀏覽代碼

😁1、goview登录去掉验证码 2、微信授权返回token去掉OpenId

zuohuaijun 2 年之前
父節點
當前提交
8e9199d4c1

+ 0 - 1
Admin.NET/Admin.NET.Core/Service/Wechat/SysWechatService.cs

@@ -97,7 +97,6 @@ public class SysWechatService : IDynamicApiController, ITransient
             accessToken = JWTEncryption.Encrypt(new Dictionary<string, object>
             {
                 { ClaimConst.UserId, wxUser.Id },
-                { ClaimConst.OpenId, wxUser.OpenId },
                 { ClaimConst.NickName, wxUser.NickName },
                 { ClaimConst.LoginMode, LoginModeEnum.APP },
             })

+ 0 - 1
Admin.NET/Admin.NET.Core/Service/Wechat/SysWxOpenService.cs

@@ -106,7 +106,6 @@ public class SysWxOpenService : IDynamicApiController, ITransient
             accessToken = JWTEncryption.Encrypt(new Dictionary<string, object>
             {
                 { ClaimConst.UserId, wxUser.Id },
-                { ClaimConst.OpenId, wxUser.OpenId },
                 { ClaimConst.RealName, wxUser.NickName },
                 { ClaimConst.LoginMode, LoginModeEnum.APP },
             })

+ 9 - 1
Admin.NET/Plugins/Admin.NET.Plugin.GoView/Service/GoViewSys/GoViewSysService.cs

@@ -18,11 +18,15 @@ public class GoViewSysService : IDynamicApiController
 {
     private readonly SysAuthService _sysAuthService;
     private readonly SqlSugarRepository<SysUser> _sysUserRep;
+    private readonly SysCacheService _sysCacheService;
 
-    public GoViewSysService(SysAuthService sysAuthService, SqlSugarRepository<SysUser> sysUserRep)
+    public GoViewSysService(SysAuthService sysAuthService,
+        SqlSugarRepository<SysUser> sysUserRep,
+        SysCacheService sysCacheService)
     {
         _sysAuthService = sysAuthService;
         _sysUserRep = sysUserRep;
+        _sysCacheService = sysCacheService;
     }
 
     /// <summary>
@@ -33,12 +37,16 @@ public class GoViewSysService : IDynamicApiController
     [DisplayName("GoView 登录")]
     public async Task<GoViewLoginOutput> Login(GoViewLoginInput input)
     {
+        _sysCacheService.Set(CommonConst.SysCaptcha, false);
+
         var loginResult = await _sysAuthService.Login(new LoginInput()
         {
             Account = input.Username,
             Password = input.Password,
         });
 
+        _sysCacheService.Remove(CommonConst.SysCaptcha);
+
         var sysUser = await _sysUserRep.AsQueryable().Filter(null, true).FirstAsync(u => u.Account.Equals(input.Username));
         return new GoViewLoginOutput()
         {