🔖 [dashboard 0.9.17] 404 页面

This commit is contained in:
naiba
2021-08-10 20:13:17 +08:00
parent 985ecc7c65
commit c848b9a08b
7 changed files with 20 additions and 6 deletions

View File

@@ -22,7 +22,7 @@ type AuthorizeOption struct {
func Authorize(opt AuthorizeOption) func(*gin.Context) {
return func(c *gin.Context) {
var code uint64 = http.StatusForbidden
var code = http.StatusForbidden
if opt.Guest {
code = http.StatusBadRequest
}

View File

@@ -9,7 +9,7 @@ import (
)
type ErrInfo struct {
Code uint64
Code int
Title string
Msg string
Link string
@@ -18,7 +18,7 @@ type ErrInfo struct {
func ShowErrorPage(c *gin.Context, i ErrInfo, isPage bool) {
if isPage {
c.HTML(http.StatusOK, "dashboard/error", CommonEnvironment(c, gin.H{
c.HTML(i.Code, "dashboard/error", CommonEnvironment(c, gin.H{
"Code": i.Code,
"Title": i.Title,
"Msg": i.Msg,