重构代码:Bootstrap.Client所有页面的js/css增加asp-append-version=true

This commit is contained in:
Argo-MacBookPro 2018-09-18 01:53:50 +08:00
parent b468f53e0c
commit 91deb1ecb0
4 changed files with 29 additions and 29 deletions

View File

@ -3,10 +3,10 @@
Layout = "_Root"; Layout = "_Root";
} }
@section css { @section css {
<link href="~/css/error.css" rel="stylesheet" /> <link href="~/css/error.css" rel="stylesheet" asp-append-version="true" />
} }
@section Javascript { @section javascript {
<script src="~/js/error.js"></script> <script src="~/js/error.js" asp-append-version="true"></script>
} }
<section class="error-wrapper"> <section class="error-wrapper">
<img src="~/images/404_icon.png" /> <img src="~/images/404_icon.png" />

View File

@ -11,7 +11,7 @@
</div> </div>
<div class="dropdown userinfo"> <div class="dropdown userinfo">
<a data-toggle="dropdown" class="dropdown-toggle shadow-default" href="#"> <a data-toggle="dropdown" class="dropdown-toggle shadow-default" href="#">
<img id="headerIcon" alt="" src="@Url.Content(Model.Icon)"> <img id="headerIcon" alt="" src="@Url.Content(Model.Icon)" asp-append-version="true">
<span id="userDisplayName" data-userName="@Model.UserName" class="username text-truncate d-inline-block">@Model.DisplayName</span> <span id="userDisplayName" data-userName="@Model.UserName" class="username text-truncate d-inline-block">@Model.DisplayName</span>
</a> </a>
<div class="dropdown-menu dropdown-menu-right"> <div class="dropdown-menu dropdown-menu-right">

View File

@ -4,41 +4,41 @@
} }
@section css { @section css {
<environment include="Development"> <environment include="Development">
<link href="~/css/bootstrap.css" rel="stylesheet"> <link href="~/css/bootstrap.css" rel="stylesheet" asp-append-version="true" />
<link href="~/css/font-awesome.css" rel="stylesheet" /> <link href="~/css/font-awesome.css" rel="stylesheet" asp-append-version="true" />
<link href="~/css/toastr.css" rel="stylesheet" /> <link href="~/css/toastr.css" rel="stylesheet" asp-append-version="true" />
</environment> </environment>
<environment exclude="Development"> <environment exclude="Development">
<link href="~/css/bootstrap.min.css" rel="stylesheet"> <link href="~/css/bootstrap.min.css" rel="stylesheet" asp-append-version="true">
<link href="~/css/font-awesome.min.css" rel="stylesheet" /> <link href="~/css/font-awesome.min.css" rel="stylesheet" asp-append-version="true" />
<link href="~/css/toastr.min.css" rel="stylesheet" /> <link href="~/css/toastr.min.css" rel="stylesheet" asp-append-version="true" />
</environment> </environment>
@RenderSection("css", false) @RenderSection("css", false)
<link href="~/css/theme.css" rel="stylesheet" /> <link href="~/css/theme.css" rel="stylesheet" asp-append-version="true" />
<link href="~/css/theme-responsive.css" rel="stylesheet" /> <link href="~/css/theme-responsive.css" rel="stylesheet" asp-append-version="true" />
<link href="~/css/site.css" rel="stylesheet" /> <link href="~/css/site.css" rel="stylesheet" asp-append-version="true" />
<link href="~/css/site-responsive.css" rel="stylesheet" /> <link href="~/css/site-responsive.css" rel="stylesheet" asp-append-version="true" />
@if (!string.IsNullOrEmpty(Model.Theme)) @if (!string.IsNullOrEmpty(Model.Theme))
{ {
<link href="~/css/@Model.Theme" rel="stylesheet" /> <link href="~/css/@Model.Theme" rel="stylesheet" asp-append-version="true" />
} }
} }
@section javascript { @section javascript {
<environment include="Development"> <environment include="Development">
<script src="~/js/bootstrap.bundle.js"></script> <script src="~/js/bootstrap.bundle.js" asp-append-version="true"></script>
<script src="~/js/jquery.scrollTo.js"></script> <script src="~/js/jquery.scrollTo.js" asp-append-version="true"></script>
<script src="~/js/jquery.nicescroll.js"></script> <script src="~/js/jquery.nicescroll.js" asp-append-version="true"></script>
</environment> </environment>
<environment exclude="Development"> <environment exclude="Development">
<script src="~/js/bootstrap.bundle.min.js"></script> <script src="~/js/bootstrap.bundle.min.js" asp-append-version="true"></script>
<script src="~/js/jquery.scrollTo.min.js"></script> <script src="~/js/jquery.scrollTo.min.js" asp-append-version="true"></script>
<script src="~/js/jquery.nicescroll.min.js"></script> <script src="~/js/jquery.nicescroll.min.js" asp-append-version="true"></script>
</environment> </environment>
<script src="~/js/toastr.min.js"></script> <script src="~/js/toastr.min.js" asp-append-version="true"></script>
<script src="~/js/longbow.common.js"></script> <script src="~/js/longbow.common.js" asp-append-version="true"></script>
<script src="~/js/jquery.dcjqaccordion.2.7.js"></script> <script src="~/js/jquery.dcjqaccordion.2.7.js" asp-append-version="true"></script>
<script src="~/js/common-scripts.js"></script> <script src="~/js/common-scripts.js" asp-append-version="true"></script>
@RenderSection("Javascript", false) @RenderSection("javascript", false)
} }
@await Html.PartialAsync("Header") @await Html.PartialAsync("Header")
@await Html.PartialAsync("navigator") @await Html.PartialAsync("navigator")

View File

@ -21,11 +21,11 @@
<a id="pathBase" href="~/" hidden></a> <a id="pathBase" href="~/" hidden></a>
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 --> <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<environment include="Development"> <environment include="Development">
<script src="~/js/jquery-3.3.1.js"></script> <script src="~/js/jquery-3.3.1.js" asp-append-version="true"></script>
</environment> </environment>
<environment exclude="Development"> <environment exclude="Development">
<script src="~/js/jquery-3.3.1.min.js"></script> <script src="~/js/jquery-3.3.1.min.js" asp-append-version="true"></script>
</environment> </environment>
@RenderSection("Javascript", false) @RenderSection("javascript", false)
</body> </body>
</html> </html>