푸터: 버전 정보를 파일에서 직접 읽기로 변경

This commit is contained in:
2026-06-26 18:04:51 +09:00
parent 86ce188bfc
commit 3723b3481c
2 changed files with 17 additions and 3 deletions
+17 -2
View File
@@ -1,5 +1,20 @@
@{
var versionInfo = ViewContext.HttpContext.RequestServices.GetService(typeof(VersionInfo)) as VersionInfo;
string versionText = "unknown";
try
{
var versionPath = Path.Combine(AppContext.BaseDirectory, "wwwroot", "version.txt");
if (System.IO.File.Exists(versionPath))
{
var lines = System.IO.File.ReadAllLines(versionPath);
var versionLine = lines.FirstOrDefault(l => l.StartsWith("Version:"));
var builtLine = lines.FirstOrDefault(l => l.StartsWith("Built:"));
if (versionLine != null && builtLine != null)
{
versionText = $"{versionLine.Replace("Version:", "").Trim()} | {builtLine.Replace("Built:", "").Trim()}";
}
}
}
catch { }
}
<footer class="bg-light border-top mt-5 py-4">
@@ -33,7 +48,7 @@
<a href="/taxbaik/privacy" class="text-decoration-none text-muted me-2">개인정보처리방침</a>
<a href="/taxbaik/terms" class="text-decoration-none text-muted">이용약관</a>
<div class="mt-2" style="font-size: 0.75rem; opacity: 0.7;">
🔄 버전: @(versionInfo?.Version ?? "unknown") | 배포: @(versionInfo?.Built ?? "unknown")
🔄 버전: @versionText
</div>
</div>
</div>
@@ -1,4 +1,3 @@
@using TaxBaik.Web
@namespace TaxBaik.Web.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@using global::VersionInfo