This commit is contained in:
mmrbnjd
2025-08-22 01:02:14 +03:30
parent b3c8271f18
commit b6343394b0
5 changed files with 25 additions and 13 deletions

View File

@@ -281,7 +281,7 @@ namespace Hushian.Application.Services
await _ConversationRepository.UPDATE(convModel); await _ConversationRepository.UPDATE(convModel);
} }
if (dto.Type != ConversationType.UE) if (dto.Type != ConversationType.UE)
await WriteInHubFromCompany(Response.Value, "U"+convModel.UserID); await WriteInHubFromCompany(Response.Value, convModel.UserID.ToString());
else else
{ {
var modelA = convModel.ConversationResponses.OrderBy(o => o.ID) var modelA = convModel.ConversationResponses.OrderBy(o => o.ID)
@@ -292,7 +292,7 @@ namespace Hushian.Application.Services
if (modelA.Type == ConversationType.EU) user = modelA.ExperID.Value.ToString(); if (modelA.Type == ConversationType.EU) user = modelA.ExperID.Value.ToString();
else if (modelA.Type == ConversationType.CU) user = "C"+modelA.conversation.CompanyID; else if (modelA.Type == ConversationType.CU) user = modelA.conversation.CompanyID.ToString();
await WriteInHubFromUser(Response.Value, user); await WriteInHubFromUser(Response.Value, user);
@@ -390,9 +390,9 @@ namespace Hushian.Application.Services
string user = ""; string user = "";
if (item.Type == ConversationType.EU) user = item.ExperID.Value.ToString(); if (item.Type == ConversationType.EU) user = item.ExperID.Value.ToString();
else if (item.Type == ConversationType.CU) user = "C" + item.conversation.CompanyID; else if (item.Type == ConversationType.CU) user = item.conversation.CompanyID.ToString();
else if (item.Type == ConversationType.UE) user = "U"+ item.conversation.UserID; else if (item.Type == ConversationType.UE) user = item.conversation.UserID.ToString();
await CheckMarkAsReadInHub(item.ID, user); await CheckMarkAsReadInHub(item.ID, user);

View File

@@ -28,9 +28,10 @@ namespace Hushian.Application.Services
var claims = new[] var claims = new[]
{ {
new Claim(JwtRegisteredClaimNames.Sub, new Claim(JwtRegisteredClaimNames.Sub,
Role=="User" ? "U"+userId.ToString() //Role=="User" ? "U"+userId.ToString()
:Role=="Company" ? "C"+userId.ToString() //:Role=="Company" ? "C"+userId.ToString()
:userId.ToString()), //:
userId.ToString()),
new Claim(ClaimTypes.NameIdentifier, UserName), new Claim(ClaimTypes.NameIdentifier, UserName),
new Claim(CustomClaimTypes.Uid,userId.ToString()), new Claim(CustomClaimTypes.Uid,userId.ToString()),
new Claim(ClaimTypes.Role, Role) new Claim(ClaimTypes.Role, Role)

View File

@@ -10,6 +10,7 @@
@inject AuthService authService; @inject AuthService authService;
@inject BaseController baseController; @inject BaseController baseController;
@inject UserService userService; @inject UserService userService;
@inject IJSRuntime JS
<Modal @ref="modal" /> <Modal @ref="modal" />
<Toasts class="p-3" AutoHide="true" Delay="4000" Placement="ToastsPlacement.TopRight" /> <Toasts class="p-3" AutoHide="true" Delay="4000" Placement="ToastsPlacement.TopRight" />
<div class="bb-page"> <div class="bb-page">
@@ -53,11 +54,11 @@
<div class="align-items-center justify-content-start" style="margin-right:10px"> <div class="align-items-center justify-content-start" style="margin-right:10px">
<Badge Color="BadgeColor.Primary" Style="margin-left:20px"> <Badge Color="BadgeColor.Primary" Style="margin-left:20px">
<NavLink href="@{hrefuserpanel}">لینک گفتگو کاربر با شما</NavLink> <NavLink @onclick="async()=>await route(hrefuserpanel)">لینک گفتگو کاربر با شما</NavLink>
</Badge> </Badge>
<Badge Color="BadgeColor.Info" Style="margin-left:20px"> <Badge Color="BadgeColor.Info" Style="margin-left:20px">
<NavLink href="@{hrefai}">لینک گفتگو کاربر با دستیار هوش مصنوعی</NavLink> <NavLink @onclick="async()=>await route(hrefai)">لینک گفتگو کاربر با دستیار هوش مصنوعی</NavLink>
</Badge> </Badge>
<Badge Color="BadgeColor.Light" Style="margin-left:20px"> <Badge Color="BadgeColor.Light" Style="margin-left:20px">
@@ -188,7 +189,10 @@
else if (menu == "page5") NavigationManager.NavigateTo("/Settings"); else if (menu == "page5") NavigationManager.NavigateTo("/Settings");
} }
private async Task route(string route)
{
await JS.InvokeVoidAsync("openSmallWindow", $"/{route}");
}
async Task CheckOnline() async Task CheckOnline()
{ {
var token = await localStorageService.GetItem<string>("C/key"); var token = await localStorageService.GetItem<string>("C/key");
@@ -269,3 +273,8 @@
private void ToggleSidebar() => sidebar.ToggleSidebar(); private void ToggleSidebar() => sidebar.ToggleSidebar();
} }
<script>
function openSmallWindow(url) {
window.open(url, '_blank', 'width=500,height=650,resizable=no');
}
</script>

View File

@@ -1865,6 +1865,8 @@
} }
</style> </style>
<script> <script>
// Trigger click on hidden input by id // Trigger click on hidden input by id
window.triggerClick = (elementId) => { window.triggerClick = (elementId) => {
const el = document.getElementById(elementId); const el = document.getElementById(elementId);

View File

@@ -23,7 +23,7 @@ else
<PageTitle>گفتگو با دستیار هوشمند @CompanyInfo.FullName</PageTitle> <PageTitle>گفتگو با دستیار هوشمند @CompanyInfo.FullName</PageTitle>
} }
<div class="container-fluid"> <div class="container-fluid">
<div class="row" style="height:85vh"> <div class="row" style="height:96vh">
@if (isReady) @if (isReady)
{ {
<div class="col-md-12 d-flex flex-column" style="margin-top:10px"> <div class="col-md-12 d-flex flex-column" style="margin-top:10px">