优化 登录流程

This commit is contained in:
小肥羊 2024-11-12 12:32:42 +08:00
parent dcc3664b0c
commit f3932cfaef
5 changed files with 27 additions and 16 deletions

View File

@ -17,6 +17,9 @@
<SpaceItem>
<Icon Class="action" Type="reload" Theme="outline" OnClick="Reload" />
</SpaceItem>
<SpaceItem>
<Icon Type="api" Theme="outline" OnClick="ToSwagger" />
</SpaceItem>
</Space>
</HeaderContentRender>
<RightContentRender>

View File

@ -3,6 +3,7 @@ using AntDesign.ProLayout;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Server.ProtectedBrowserStorage;
using Microsoft.Identity.Client.Extensions.Msal;
using Microsoft.JSInterop;
using System.Globalization;
using System.Net.Http.Json;
@ -15,6 +16,7 @@ namespace VideoAnalysisRazor.Layouts
[Inject] IHttpContextAccessor HttpContextAccessor { get; set; } = default!;
[Inject] private ReuseTabsService TabService { get; set; }
[Inject] private IJSRuntime JSRuntime { get; set; }
[Inject] private ProtectedSessionStorage session { get; set; } = default!;
bool collapsed;
@ -34,6 +36,13 @@ namespace VideoAnalysisRazor.Layouts
protected override async Task OnInitializedAsync()
{
_menuData = [
new MenuDataItem
{
Path = "/",
Name = "任务队列",
Key = "VideoTaskPage",
Icon = "unordered-list",
},
new MenuDataItem
{
Path = "/Project",
@ -43,10 +52,10 @@ namespace VideoAnalysisRazor.Layouts
},
new MenuDataItem
{
Path = "/",
Name = "任务队列",
Key = "VideoTaskPage",
Icon = "unordered-list",
Path = "/Login",
Name = "登录页",
Key = "Login",
HideInMenu = true,
}
];
}
@ -59,6 +68,10 @@ namespace VideoAnalysisRazor.Layouts
{
TabService.ReloadPage();
}
async Task ToSwagger()
{
await JSRuntime.InvokeVoidAsync("open", "/swagger/index.html", "_blank");
}
public void Dispose()
{

View File

@ -5,7 +5,7 @@
@using SqlSugar
@using VideoAnalysisCore.Model
@using VideoAnalysisCore.Model.Dto
@attribute [ReuseTabsPage(Ignore = true)]
<section style="width:100%;height:100%">
<!-- 背景颜色 -->

View File

@ -41,7 +41,7 @@ namespace Learn.VideoAnalysis.Controllers
/// <param name="tagId">×Ô¶¨Òåid</param>
/// <returns></returns>
[HttpGet(Name = "TaskInfo")]
public async Task<IActionResult> TaskInfo(long taskId,string tagId)
public async Task<IActionResult> TaskInfo(long taskId,string? tagId)
{
var task = await videoTaskDB.AsQueryable()
.WhereIF(taskId!=0, s => s.Id == taskId)

View File

@ -50,21 +50,16 @@ namespace VideoAnalysisCore.Model.Dto
[DisplayName("媒体路径")]
public string MediaUrl { get; set; } = string.Empty;
/// <summary>
/// 自定义值 任务完成后附带通知
/// 自定义ID
/// </summary>
[DisplayName("自定义")]
public string? Tag { get; set; }
[DisplayName("自定义ID")]
public string? TagId { get; set; }
/// <summary>
/// 消耗token
/// </summary>
[DisplayName("消耗Token")]
public int TotalTokens { get; set; }
/// <summary>
///回调Api地址
/// </summary>
[DisplayName("回调地址")]
public string? CallBackUrl { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[DisplayName("创建时间")]