From 316e5da09de991c95ae73f1984dde28d2ea3e059 Mon Sep 17 00:00:00 2001
From: ydy <517697206@qq.com>
Date: Tue, 23 Jul 2024 15:46:18 +0800
Subject: [PATCH] feat:add authorization for imaotai web and wpf
---
IMaoTai.Core/CommonX.cs | 3 +
IMaoTai.Core/IMaoTai.Core.csproj | 1 +
IMaoTai.MasaBlazor/Components/App.razor | 5 +-
IMaoTai.MasaBlazor/Helpers/IocHelper.cs | 7 +-
IMaoTai.MasaBlazor/Program.cs | 14 ++-
.../Properties/launchSettings.json | 33 ++-----
IMaoTai.MasaUI/Config.cs | 12 +--
.../Core/HostAuthenticationStateProvider.cs | 65 +++++-------
.../Core/WHostAuthenticationStateProvider.cs | 95 ++++++++++++++++++
IMaoTai.MasaUI/IMaoTai.MasaUI.csproj | 1 +
IMaoTai.MasaUI/NoAuthorizeRoutes.razor | 1 -
IMaoTai.MasaUI/Pages/Index.razor | 3 -
IMaoTai.MasaUI/Pages/InstructionsData.razor | 1 -
IMaoTai.MasaUI/Pages/LogData.razor | 5 -
IMaoTai.MasaUI/Pages/LoginData.razor | 99 ++++++-------------
IMaoTai.MasaUI/Pages/ProductData.razor | 9 +-
IMaoTai.MasaUI/Pages/ShopData.razor | 5 -
IMaoTai.MasaUI/Pages/UserData.razor | 5 -
IMaoTai.MasaUI/Routes.razor | 72 ++++++--------
IMaoTai.sln | 4 +
IMaoTai/Helpers/IocHelper.cs | 8 +-
IMaoTai/IMaoTai.csproj | 5 +-
IMaoTai/wwwroot/index.html | 2 +-
23 files changed, 233 insertions(+), 222 deletions(-)
create mode 100644 IMaoTai.MasaUI/Core/WHostAuthenticationStateProvider.cs
diff --git a/IMaoTai.Core/CommonX.cs b/IMaoTai.Core/CommonX.cs
index fad135a..49f4210 100644
--- a/IMaoTai.Core/CommonX.cs
+++ b/IMaoTai.Core/CommonX.cs
@@ -25,6 +25,9 @@ public class CommonX
//登录用户账号缓存
public static string LoginUserListFile = Path.Combine(CacheDir, "loginUserList.json");
+ //登录账户session缓存(wpf)
+ public static string LoginCacheUserListFile = Path.Combine(CacheDir, "loginCacheUserList.json");
+
///