This commit is contained in:
zel
2025-02-07 16:16:10 +08:00
parent 83aade6ac7
commit e38d4d76a2
24 changed files with 119 additions and 159 deletions

View File

@@ -48,13 +48,13 @@ namespace TightWiki.Controllers
returnUrl ??= Url.Content("~/");
if (remoteError != null)
{
return NotifyOfError($"Error from external provider: {remoteError}");
return NotifyOfError($"外部提供程序出错: {remoteError}");
}
var info = await SignInManager.GetExternalLoginInfoAsync();
if (info == null)
{
return NotifyOfError($"Failed to get information from external provider");
return NotifyOfError($"无法从外部提供程序获取信息");
}
var user = await UserManager.FindByLoginAsync(info.LoginProvider, info.ProviderKey);
@@ -83,7 +83,7 @@ namespace TightWiki.Controllers
var email = info.Principal.FindFirstValue(ClaimTypes.Email).EnsureNotNull();
if (string.IsNullOrEmpty(email))
{
return NotifyOfError($"The email address was not supplied by the external provider.");
return NotifyOfError($"电子邮件地址不是由外部提供商提供的.");
}
user = await UserManager.FindByEmailAsync(email);

View File

@@ -81,23 +81,23 @@ namespace TightWiki.Controllers
case "Optimize":
{
var resultText = SpannedRepository.OptimizeDatabase(database);
return NotifyOfSuccess($"Optimization complete. {resultText}", model.YesRedirectURL);
return NotifyOfSuccess($"操作成功 {resultText}", model.YesRedirectURL);
}
case "Vacuum":
{
var resultText = SpannedRepository.OptimizeDatabase(database);
return NotifyOfSuccess($"Vacuum complete. {resultText}", model.YesRedirectURL);
return NotifyOfSuccess($"操作成功 {resultText}", model.YesRedirectURL);
}
case "Verify":
{
var resultText = SpannedRepository.OptimizeDatabase(database);
return NotifyOfSuccess($"Verification complete. {resultText}", model.YesRedirectURL);
return NotifyOfSuccess($"验证完成 {resultText}", model.YesRedirectURL);
}
}
}
catch (Exception ex)
{
return NotifyOfError($"Operation failed: {ex.Message}.", model.YesRedirectURL);
return NotifyOfError($"操作失败: {ex.Message}.", model.YesRedirectURL);
}
return NotifyOfError($"Unknown database action: '{databaseAction}'.", model.YesRedirectURL);
@@ -138,7 +138,7 @@ namespace TightWiki.Controllers
if (model.UserSelection == true)
{
StatisticsRepository.PurgeCompilationStatistics();
return NotifyOfSuccess("Compilation statistics purged.", model.YesRedirectURL);
return NotifyOfSuccess("操作成功", model.YesRedirectURL);
}
return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}");
@@ -153,7 +153,7 @@ namespace TightWiki.Controllers
if (model.UserSelection == true)
{
WikiCache.Clear();
return NotifyOfSuccess("Memory cache purged.", model.YesRedirectURL);
return NotifyOfSuccess("操作成功", model.YesRedirectURL);
}
return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}");
@@ -367,12 +367,12 @@ namespace TightWiki.Controllers
int currentPageRevision = PageRepository.GetCurrentPageRevision(page.Id);
if (revision >= currentPageRevision)
{
return NotifyOfError("You cannot revert to the current page revision.");
return NotifyOfError("操作失败");
}
Engine.Implementation.Helpers.UpsertPage(tightEngine, page, SessionState);
return NotifyOfSuccess("The page has been reverted.", model.YesRedirectURL);
return NotifyOfSuccess("操作成功", model.YesRedirectURL);
}
return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}");
@@ -396,7 +396,7 @@ namespace TightWiki.Controllers
var page = PageRepository.GetLimitedPageInfoByIdAndRevision(pageId);
if (page == null)
{
return NotifyOfError("The specified page could not be found.");
return NotifyOfError("找不到指定页面");
}
model.Name = page.Name;
@@ -489,13 +489,13 @@ namespace TightWiki.Controllers
var page = PageRepository.GetPageInfoByNavigation(pageNavigation);
if (page == null)
{
return NotifyOfError("The page could not be found.");
return NotifyOfError("无法找到指定页面");
}
int revisionCount = PageRepository.GetPageRevisionCountByPageId(page.Id);
if (revisionCount <= 1)
{
return NotifyOfError("You cannot delete the only existing revision of a page, instead you would need to delete the entire page.");
return NotifyOfError("唯一修订无法删除");
}
//If we are deleting the latest revision, then we need to grab the previous
@@ -509,7 +509,7 @@ namespace TightWiki.Controllers
PageRepository.MovePageRevisionToDeletedById(page.Id, revision, SessionState.Profile.EnsureNotNull().UserId);
return NotifyOfSuccess("Page revision has been moved to the deletion queue.", model.YesRedirectURL);
return NotifyOfSuccess("操作成功页面修订已移至删除队列", model.YesRedirectURL);
}
return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}");
@@ -575,7 +575,7 @@ namespace TightWiki.Controllers
{
Engine.Implementation.Helpers.RefreshPageMetadata(tightEngine, page, SessionState);
}
return NotifyOfSuccess("All pages have been rebuilt.", model.YesRedirectURL);
return NotifyOfSuccess("操作成功", model.YesRedirectURL);
}
return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}");
@@ -621,7 +621,7 @@ namespace TightWiki.Controllers
workload.WaitForCompletion();
return NotifyOfSuccess("All pages have been cached.", model.YesRedirectURL);
return NotifyOfSuccess("操作成功", model.YesRedirectURL);
}
return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}");
@@ -637,7 +637,7 @@ namespace TightWiki.Controllers
{
PageRepository.TruncateAllPageRevisions("YES");
WikiCache.Clear();
return NotifyOfSuccess("All page revisions have been truncated.", model.YesRedirectURL);
return NotifyOfSuccess("操作成功", model.YesRedirectURL);
}
return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}");
@@ -652,7 +652,7 @@ namespace TightWiki.Controllers
if (model.UserSelection == true)
{
PageRepository.PurgeDeletedPageRevisionsByPageId(pageId);
return NotifyOfSuccess("The page deletion queue has been purged.", model.YesRedirectURL);
return NotifyOfSuccess("操作成功", model.YesRedirectURL);
}
return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}");
@@ -667,7 +667,7 @@ namespace TightWiki.Controllers
if (model.UserSelection == true)
{
PageRepository.PurgeDeletedPageRevisionByPageIdAndRevision(pageId, revision);
return NotifyOfSuccess("The page revision has been purged from the deletion queue.", model.YesRedirectURL);
return NotifyOfSuccess("操作成功", model.YesRedirectURL);
}
return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}");
@@ -682,7 +682,7 @@ namespace TightWiki.Controllers
if (model.UserSelection == true)
{
PageRepository.RestoreDeletedPageRevisionByPageIdAndRevision(pageId, revision);
return NotifyOfSuccess("The page revision has been restored.", model.YesRedirectURL);
return NotifyOfSuccess("操作成功", model.YesRedirectURL);
}
return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}");
@@ -697,7 +697,7 @@ namespace TightWiki.Controllers
if (model.UserSelection == true)
{
PageRepository.PurgeDeletedPages();
return NotifyOfSuccess("The page deletion queue has been purged.", model.YesRedirectURL);
return NotifyOfSuccess("操作成功", model.YesRedirectURL);
}
return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}");
@@ -712,7 +712,7 @@ namespace TightWiki.Controllers
if (model.UserSelection == true)
{
PageRepository.PurgeDeletedPageByPageId(pageId);
return NotifyOfSuccess("The page has been purged from the deletion queue.", model.YesRedirectURL);
return NotifyOfSuccess("操作成功", model.YesRedirectURL);
}
return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}");
@@ -727,7 +727,7 @@ namespace TightWiki.Controllers
if (model.UserSelection == true)
{
PageRepository.MovePageToDeletedById(pageId, SessionState.Profile.EnsureNotNull().UserId);
return NotifyOfSuccess("The page has been moved to the deletion queue.", model.YesRedirectURL);
return NotifyOfSuccess("操作成功", model.YesRedirectURL);
}
return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}");
@@ -747,7 +747,7 @@ namespace TightWiki.Controllers
{
Engine.Implementation.Helpers.RefreshPageMetadata(tightEngine, page, SessionState);
}
return NotifyOfSuccess("The page has restored.", model.YesRedirectURL);
return NotifyOfSuccess("操作成功", model.YesRedirectURL);
}
return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}");
@@ -798,7 +798,7 @@ namespace TightWiki.Controllers
if (model.UserSelection == true)
{
PageFileRepository.PurgeOrphanedPageAttachments();
return NotifyOfSuccess("All orphaned page attachments have been purged.", model.YesRedirectURL);
return NotifyOfSuccess("操作成功", model.YesRedirectURL);
}
return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}");
@@ -814,7 +814,7 @@ namespace TightWiki.Controllers
if (model.UserSelection == true)
{
PageFileRepository.PurgeOrphanedPageAttachment(pageFileId, revision);
return NotifyOfSuccess("The pages orphaned attachments have been purged.", model.YesRedirectURL);
return NotifyOfSuccess("操作成功", model.YesRedirectURL);
}
return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}");
@@ -883,7 +883,7 @@ namespace TightWiki.Controllers
if (ConfigurationRepository.GetAllMenuItems().Where(o => o.Name.Equals(model.Name, StringComparison.InvariantCultureIgnoreCase) && o.Id != model.Id).Any())
{
ModelState.AddModelError("Name", $"The menu name '{model.Name}' is already in use.");
ModelState.AddModelError("Name", $"菜单名 '{model.Name}' 已被使用");
return View(model);
}
@@ -892,14 +892,14 @@ namespace TightWiki.Controllers
model.Id = ConfigurationRepository.InsertMenuItem(model.ToDataModel());
ModelState.Clear();
return NotifyOfSuccess("The menu item has been created.", $"/Admin/MenuItem/{model.Id}");
return NotifyOfSuccess("创建成功", $"/Admin/MenuItem/{model.Id}");
}
else
{
ConfigurationRepository.UpdateMenuItemById(model.ToDataModel());
}
model.SuccessMessage = "The menu item has been saved.";
model.SuccessMessage = "操作成功!";
return View(model);
}
@@ -926,7 +926,7 @@ namespace TightWiki.Controllers
{
ConfigurationRepository.DeleteMenuItemById(model.Id);
return NotifyOfSuccess("The menu item has been deleted.", $"/Admin/MenuItems");
return NotifyOfSuccess("删除成功", $"/Admin/MenuItems");
}
return Redirect($"{GlobalConfiguration.BasePath}/Admin/MenuItem/{model.Id}");
@@ -1057,7 +1057,7 @@ namespace TightWiki.Controllers
{
if (UsersRepository.DoesProfileAccountExist(model.AccountProfile.AccountName))
{
ModelState.AddModelError("AccountProfile.AccountName", "Account name is already in use.");
ModelState.AddModelError("AccountProfile.AccountName", "用户名已经被使用");
return View(model);
}
}
@@ -1066,7 +1066,7 @@ namespace TightWiki.Controllers
{
if (UsersRepository.DoesEmailAddressExist(model.AccountProfile.EmailAddress))
{
ModelState.AddModelError("AccountProfile.EmailAddress", "Email address is already in use.");
ModelState.AddModelError("AccountProfile.EmailAddress", "该邮箱已经存在");
return View(model);
}
}
@@ -1076,11 +1076,11 @@ namespace TightWiki.Controllers
{
if (GlobalConfiguration.AllowableImageTypes.Contains(file.ContentType.ToLower()) == false)
{
model.ErrorMessage += "Could not save the attached image, type not allowed.\r\n";
model.ErrorMessage += "无法保存附件图片, 不允许的格式.\r\n";
}
else if (file.Length > GlobalConfiguration.MaxAvatarFileSize)
{
model.ErrorMessage += "Could not save the attached image, too large.\r\n";
model.ErrorMessage += "无法保存附件图片, 图片过大.\r\n";
}
else
{
@@ -1092,7 +1092,7 @@ namespace TightWiki.Controllers
}
catch
{
model.ErrorMessage += "Could not save the attached image.\r\n";
model.ErrorMessage += "无法保存附件图片.\r\n";
}
}
}
@@ -1167,7 +1167,7 @@ namespace TightWiki.Controllers
}
}
model.SuccessMessage = "Your profile has been saved successfully!";
model.SuccessMessage = "操作成功!";
return View(model);
}
@@ -1228,19 +1228,19 @@ namespace TightWiki.Controllers
if (string.IsNullOrWhiteSpace(model.AccountProfile.AccountName))
{
ModelState.AddModelError("AccountProfile.AccountName", "Account name is required.");
ModelState.AddModelError("AccountProfile.AccountName", "用户名为必填项");
return View(model);
}
if (UsersRepository.DoesProfileAccountExist(model.AccountProfile.AccountName))
{
ModelState.AddModelError("AccountProfile.AccountName", "Account name is already in use.");
ModelState.AddModelError("AccountProfile.AccountName", "用户名已经在使用");
return View(model);
}
if (UsersRepository.DoesEmailAddressExist(model.AccountProfile.EmailAddress))
{
ModelState.AddModelError("AccountProfile.EmailAddress", "Email address is already in use.");
ModelState.AddModelError("AccountProfile.EmailAddress", "邮箱已经被使用");
return View(model);
}
@@ -1298,11 +1298,11 @@ namespace TightWiki.Controllers
{
if (GlobalConfiguration.AllowableImageTypes.Contains(file.ContentType.ToLower()) == false)
{
model.ErrorMessage += "Could not save the attached image, type not allowed.\r\n";
model.ErrorMessage += "无法保存附件图片, 不支持的格式.\r\n";
}
else if (file.Length > GlobalConfiguration.MaxAvatarFileSize)
{
model.ErrorMessage += "Could not save the attached image, too large.\r\n";
model.ErrorMessage += "无法保存附件图片, 图片过大.\r\n";
}
else
{
@@ -1314,12 +1314,12 @@ namespace TightWiki.Controllers
}
catch
{
model.ErrorMessage += "Could not save the attached image.";
model.ErrorMessage += "无法保存附件图片.";
}
}
}
return NotifyOf("The account has been created.", model.ErrorMessage, $"/Admin/Account/{profile.Navigation}");
return NotifyOf("创建成功", model.ErrorMessage, $"/Admin/Account/{profile.Navigation}");
}
[Authorize]
@@ -1367,7 +1367,7 @@ namespace TightWiki.Controllers
var user = UserManager.FindByIdAsync(profile.UserId.ToString()).Result;
if (user == null)
{
return NotFound("User not found.");
return NotFound("404 404 404");
}
var result = UserManager.DeleteAsync(user).Result;
@@ -1384,10 +1384,10 @@ namespace TightWiki.Controllers
//We're deleting our own account. Oh boy...
SignInManager.SignOutAsync();
return NotifyOfSuccess("Your account has been deleted.", $"/Profile/Deleted");
return NotifyOfSuccess("操作成功", $"/Profile/Deleted");
}
return NotifyOfSuccess("The account has been deleted.", $"/Admin/Accounts");
return NotifyOfSuccess("操作成功", $"/Admin/Accounts");
}
return Redirect($"{GlobalConfiguration.BasePath}/Admin/Account/{navigation}");
@@ -1498,7 +1498,7 @@ namespace TightWiki.Controllers
WikiCache.ClearCategory(WikiCache.Category.Configuration);
model.SuccessMessage = "The configuration has been saved successfully!";
model.SuccessMessage = "操作成功!";
}
catch (Exception ex)
{
@@ -1577,7 +1577,7 @@ namespace TightWiki.Controllers
var checkName = EmojiRepository.GetEmojiByName(model.Emoji.Name.ToLowerInvariant());
if (checkName != null)
{
ModelState.AddModelError("Emoji.Name", "Emoji name is already in use.");
ModelState.AddModelError("Emoji.Name", "Emoji名称已经被使用");
return View(model);
}
}
@@ -1594,7 +1594,7 @@ namespace TightWiki.Controllers
{
if (file.Length > GlobalConfiguration.MaxEmojiFileSize)
{
model.ErrorMessage += "Could not save the attached image, too large.";
model.ErrorMessage += "无法保存附件图片, 图片过大.";
}
else
{
@@ -1606,14 +1606,14 @@ namespace TightWiki.Controllers
}
catch
{
model.ErrorMessage += "Could not save the attached image.";
model.ErrorMessage += "无法保存附件图片.";
}
}
}
emoji.Id = EmojiRepository.UpsertEmoji(emoji);
model.OriginalName = model.Emoji.Name;
model.SuccessMessage = "The emoji has been saved successfully!";
model.SuccessMessage = "操作成功!";
model.Emoji.Id = (int)emoji.Id;
ModelState.Clear();
@@ -1621,7 +1621,7 @@ namespace TightWiki.Controllers
if (nameChanged)
{
return NotifyOfSuccess("The emoji has been saved.", $"/Admin/Emoji/{Navigation.Clean(emoji.Name)}");
return NotifyOfSuccess("操作成功", $"/Admin/Emoji/{Navigation.Clean(emoji.Name)}");
}
return View(model);
@@ -1664,7 +1664,7 @@ namespace TightWiki.Controllers
var checkName = EmojiRepository.GetEmojiByName(model.Name.ToLower());
if (checkName != null)
{
ModelState.AddModelError("Name", "Emoji name is already in use.");
ModelState.AddModelError("Name", "Emoji名已经存在");
return View(model);
}
}
@@ -1681,7 +1681,7 @@ namespace TightWiki.Controllers
{
if (file.Length > GlobalConfiguration.MaxEmojiFileSize)
{
ModelState.AddModelError("Name", "Could not save the attached image, too large.");
ModelState.AddModelError("Name", "无法保存附件图片, 图片过大.");
}
else
{
@@ -1693,14 +1693,14 @@ namespace TightWiki.Controllers
}
catch
{
ModelState.AddModelError("Name", "Could not save the attached image.");
ModelState.AddModelError("Name", "无法保存附件图片.");
}
}
}
EmojiRepository.UpsertEmoji(emoji);
return NotifyOfSuccess("The emoji has been created.", $"/Admin/Emoji/{Navigation.Clean(emoji.Name)}");
return NotifyOfSuccess("操作成功", $"/Admin/Emoji/{Navigation.Clean(emoji.Name)}");
}
[Authorize]
@@ -1716,7 +1716,7 @@ namespace TightWiki.Controllers
{
EmojiRepository.DeleteById(emoji.Id);
return NotifyOfSuccess("The emoji has been deleted.", $"/Admin/Emojis");
return NotifyOfSuccess("操作成功", $"/Admin/Emojis");
}
return Redirect($"{GlobalConfiguration.BasePath}/Admin/Emoji/{name}");
@@ -1793,7 +1793,7 @@ namespace TightWiki.Controllers
if (model.UserSelection == true)
{
ExceptionRepository.PurgeExceptions();
return NotifyOfSuccess("All exceptions have been purged.", model.YesRedirectURL);
return NotifyOfSuccess("操作成功", model.YesRedirectURL);
}
return Redirect($"{GlobalConfiguration.BasePath}{model.NoRedirectURL}");

View File

@@ -19,7 +19,7 @@ namespace TightWiki.Controllers
: WikiControllerBase(signInManager, userManager)
{
/// <summary>
/// Gets an image attached to a page.
/// 获取附加到页面的图像
/// </summary>
/// <param name="givenPageNavigation">The navigation link of the page.</param>
/// <param name="givenFileNavigation">The navigation link of the file.</param>
@@ -97,7 +97,7 @@ namespace TightWiki.Controllers
}
else
{
return NotFound($"[{fileNavigation}] was not found on the page [{pageNavigation}].");
return NotFound($"[{fileNavigation}] 无法在页面 [{pageNavigation}] 中找到.");
}
}
@@ -176,7 +176,7 @@ namespace TightWiki.Controllers
}
else
{
return NotFound($"[{fileNavigation}] was not found on the page [{pageNavigation}].");
return NotFound($"[{fileNavigation}] 无法在页面 [{pageNavigation}] 中找到.");
}
}
@@ -205,7 +205,7 @@ namespace TightWiki.Controllers
else
{
HttpContext.Response.StatusCode = 404;
return NotFound($"[{fileNavigation}] was not found on the page [{pageNavigation}].");
return NotFound($"[{fileNavigation}] 无法在页面 [ {pageNavigation} ] 中找到.");
}
}
@@ -288,7 +288,7 @@ namespace TightWiki.Controllers
{
if (fileSize > GlobalConfiguration.MaxAttachmentFileSize)
{
return Json(new { message = $"Could not attach file: [{file.FileName}], too large." });
return Json(new { message = $"无法保存文件: [{file.FileName}], 文件过大." });
}
var fileName = HttpUtility.UrlDecode(file.FileName);
@@ -310,8 +310,8 @@ namespace TightWiki.Controllers
}
catch (Exception ex)
{
ExceptionRepository.InsertException(ex, "Failed to upload file.");
return StatusCode(500, new { success = false, message = $"An error occurred: {ex.Message}" });
ExceptionRepository.InsertException(ex, "文件上传失败.");
return StatusCode(500, new { success = false, message = $"Error: {ex.Message}" });
}
}
@@ -337,7 +337,7 @@ namespace TightWiki.Controllers
{
if (fileSize > GlobalConfiguration.MaxAttachmentFileSize)
{
return Content("Could not save the attached file, too large");
return Content("附件无法保存, 文件过大");
}
var fileName = HttpUtility.UrlDecode(fileData.FileName);
@@ -353,11 +353,11 @@ namespace TightWiki.Controllers
ContentType = Utility.GetMimeType(fileName)
}, (SessionState.Profile?.UserId).EnsureNotNullOrEmpty());
return Content("Success");
return Content("成功");
}
}
return Content("Failure");
return Content("失败");
}
/// <summary>
@@ -415,7 +415,7 @@ namespace TightWiki.Controllers
if (emoji.ImageData == null)
{
return NotFound($"Emoji {pageNavigation} was not found");
return NotFound($"Emoji {pageNavigation} 无法找到");
}
WikiCache.Put(imageCacheKey, emoji.ImageData);
@@ -475,7 +475,7 @@ namespace TightWiki.Controllers
}
}
return NotFound($"Emoji {pageNavigation} was not found");
return NotFound($"Emoji {pageNavigation} 无法找到");
}
}
}

View File

@@ -640,7 +640,7 @@ namespace TightWiki.Controllers
SessionState.SetPageId(page.Id);
model.SuccessMessage = "The page was saved.";
model.SuccessMessage = "保存成功";
if (string.IsNullOrWhiteSpace(originalNavigation) == false)
{
@@ -736,7 +736,7 @@ namespace TightWiki.Controllers
}
else
{
return NotFound($"[{fileNavigation}] was not found on the page [{pageNavigation}].");
return NotFound($"[{fileNavigation}] 无法在页面 [ {pageNavigation} ] 中找到.");
}
}
@@ -802,7 +802,7 @@ namespace TightWiki.Controllers
}
else
{
return NotFound($"[{fileNavigation}] was not found on the page [{pageNavigation}].");
return NotFound($"[{fileNavigation}] 无法在页面 [{pageNavigation}] 中找到.");
}
}
@@ -830,7 +830,7 @@ namespace TightWiki.Controllers
else
{
HttpContext.Response.StatusCode = 404;
return NotFound($"[{fileNavigation}] was not found on the page [{pageNavigation}].");
return NotFound($"[{fileNavigation}] 无法在页面 [{pageNavigation}] 中找到.");
}
}

View File

@@ -347,7 +347,7 @@ namespace TightWiki.Controllers
WikiCache.ClearCategory(WikiCacheKey.Build(WikiCache.Category.User, [profile.Navigation]));
WikiCache.ClearCategory(WikiCacheKey.Build(WikiCache.Category.User, [profile.UserId]));
model.SuccessMessage = "Your profile has been saved.";
model.SuccessMessage = "保存成功";
//This is not 100% necessary, I just want to prevent the user from needing to refresh to view the new theme.
SessionState.UserTheme = ConfigurationRepository.GetAllThemes().SingleOrDefault(o => o.Name == model.AccountProfile.Theme) ?? GlobalConfiguration.SystemTheme;
@@ -378,7 +378,7 @@ namespace TightWiki.Controllers
var user = UserManager.FindByIdAsync(profile.UserId.ToString()).Result;
if (user == null)
{
return NotFound("User not found.");
return NotFound("User 404 404 404.");
}
var result = UserManager.DeleteAsync(user).Result;