用户增加工作语言,系统文档增加文档适用语言用户

This commit is contained in:
2026-05-12 11:45:55 +08:00
parent 9ee85bfa3c
commit 577f35a3fe
31 changed files with 22500 additions and 45 deletions
@@ -1,4 +1,6 @@
namespace IRaCIS.Core.Domain.Share
using IRaCIS.Core.Domain.Models;
namespace IRaCIS.Core.Domain.Share
{
/// <summary>
/// 用户信息接口
@@ -59,5 +61,7 @@
string TimeZoneId { get; }
string BrowserFingerprint { get; }
UserWorkLanguage UserWorkLanguage { get; }
}
}
+22 -1
View File
@@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Http;
using IRaCIS.Core.Domain.Models;
using Microsoft.AspNetCore.Http;
namespace IRaCIS.Core.Domain.Share
{
@@ -328,6 +329,25 @@ namespace IRaCIS.Core.Domain.Share
}
}
public UserWorkLanguage UserWorkLanguage
{
get
{
var userWorkLanguage = _accessor?.HttpContext?.User?.FindFirst(JwtIRaCISClaimType.UserWorkLanguage);
if (userWorkLanguage != null && !string.IsNullOrEmpty(userWorkLanguage.Value))
{
return Enum.Parse<UserWorkLanguage>(userWorkLanguage.Value);
}
else
{
return UserWorkLanguage.US;
}
}
}
public Guid? SignId
{
@@ -397,6 +417,7 @@ namespace IRaCIS.Core.Domain.Share
public const string PermissionStr = "permissionStr";
public const string UserWorkLanguage = "userWorkLanguage";
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,52 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace IRaCIS.Core.Infra.EFCore.Migrations
{
/// <inheritdoc />
public partial class addWorkLanguage : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "Country",
table: "TrialSite",
type: "nvarchar(400)",
maxLength: 400,
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn<int>(
name: "DocLanguageType",
table: "SystemDocument",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "UserWorkLanguage",
table: "IdentityUser",
type: "int",
nullable: false,
defaultValue: 0);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "Country",
table: "TrialSite");
migrationBuilder.DropColumn(
name: "DocLanguageType",
table: "SystemDocument");
migrationBuilder.DropColumn(
name: "UserWorkLanguage",
table: "IdentityUser");
}
}
}
@@ -3682,6 +3682,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
.HasColumnType("nvarchar(400)")
.UseCollation("Chinese_PRC_CS_AS");
b.Property<int>("UserWorkLanguage")
.HasColumnType("int");
b.HasKey("Id");
SqlServerKeyBuilderExtensions.IsClustered(b.HasKey("Id"), false);
@@ -11261,6 +11264,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
b.Property<DateTime?>("DeletedTime")
.HasColumnType("datetime2");
b.Property<int>("DocLanguageType")
.HasColumnType("int");
b.Property<int>("DocUserSignType")
.HasColumnType("int");
@@ -14870,6 +14876,11 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
b.Property<Guid>("Id")
.HasColumnType("uniqueidentifier");
b.Property<string>("Country")
.IsRequired()
.HasMaxLength(400)
.HasColumnType("nvarchar(400)");
b.Property<DateTime>("CreateTime")
.HasColumnType("datetime2");