test: 完善单元测试

This commit is contained in:
陈淳
2024-04-29 17:50:51 +08:00
parent 32aca8c6a8
commit 29ee0b5945
16 changed files with 509 additions and 28 deletions

View File

@@ -56,7 +56,15 @@ namespace Yi.Framework.Rbac.Domain.Entities
{
var str = context.GetUserAgent();
var uaParser = Parser.GetDefault();
ClientInfo c = uaParser.Parse(str);
ClientInfo c;
try
{
c = uaParser.Parse(str);
}
catch
{
c = new ClientInfo("null",new OS("null", "null", "null", "null", "null"),new Device("null","null","null"), new UserAgent("null", "null", "null", "null"));
}
return c;
}
var ipAddr = context.GetClientIp();