You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
iot/projects/Infrastructure/Views/Shared/Error.cshtml

27 lines
893 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

@using Microsoft.AspNetCore.Diagnostics
@{
Layout = null;
var error = ViewContext.HttpContext.Features.Get<IExceptionHandlerFeature>()?.Error;
var title = error == null ? "404" : "500";
var message = error == null ? "无法找到该页面" : "服务器处理请求时发生错误";
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>@title</title>
</head>
<body data-senna data-senna-surface>
<!--@error?.Message-->
<!--@error?.ToString()-->
<!--@error?.StackTrace-->
<h1>@(error == null ? "404" : "500")</h1>
<p><a href="@Url.Action("Index","Home")">@message点击返回首页。</a></p>
<script>
var isApp = /android|iPad|iPhone|iPod/i.test(navigator.userAgent || navigator.vendor || window.opera);
if (isApp) {
window.location.href = "uniwebview://error";
}
</script>
</body>
</html>