From 9e685be6a2a6cddf967f90293def065f2ea81b63 Mon Sep 17 00:00:00 2001
From: croire <1432593898@qq.com>
Date: Sat, 23 Oct 2021 16:15:46 +0800
Subject: [PATCH] =?UTF-8?q?=E7=9B=91=E5=90=AC=E5=89=AA=E8=B4=B4=E6=9D=BF?=
=?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=94=AF=E6=8C=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
DownKyi/ViewModels/MainWindowViewModel.cs | 39 ++++++++++++++++++++++-
1 file changed, 38 insertions(+), 1 deletion(-)
diff --git a/DownKyi/ViewModels/MainWindowViewModel.cs b/DownKyi/ViewModels/MainWindowViewModel.cs
index 135f879..8f57848 100644
--- a/DownKyi/ViewModels/MainWindowViewModel.cs
+++ b/DownKyi/ViewModels/MainWindowViewModel.cs
@@ -361,6 +361,43 @@ namespace DownKyi.ViewModels
{
NavigationView(ViewVideoDetailViewModel.Tag, input);
}
+ // 用户(参数传入mid)
+ else if (ParseEntrance.IsUserId(input))
+ {
+ NavigateToViewUserSpace(ParseEntrance.GetUserId(input));
+ }
+ else if (ParseEntrance.IsUserUrl(input))
+ {
+ NavigateToViewUserSpace(ParseEntrance.GetUserId(input));
+ }
+ // 收藏夹
+ else if (ParseEntrance.IsFavoritesId(input))
+ {
+ NavigationView(ViewPublicFavoritesViewModel.Tag, ParseEntrance.GetFavoritesId(input));
+ }
+ else if (ParseEntrance.IsFavoritesUrl(input))
+ {
+ NavigationView(ViewPublicFavoritesViewModel.Tag, ParseEntrance.GetFavoritesId(input));
+ }
+ }
+
+ ///
+ /// 导航到用户空间,
+ /// 如果传入的mid与本地登录的mid一致,
+ /// 则进入我的用户空间。
+ ///
+ ///
+ private void NavigateToViewUserSpace(long mid)
+ {
+ var userInfo = SettingsManager.GetInstance().GetUserInfo();
+ if (userInfo != null && userInfo.Mid == mid)
+ {
+ NavigationView(ViewMySpaceViewModel.Tag, mid);
+ }
+ else
+ {
+ NavigationView(ViewUserSpaceViewModel.Tag, mid);
+ }
}
///
@@ -368,7 +405,7 @@ namespace DownKyi.ViewModels
///
///
///
- private void NavigationView(string viewName, string param)
+ private void NavigationView(string viewName, object param)
{
LogManager.Debug("OnClipboardUpdated", $"NavigationView: {viewName}, Parameter: {param}");