|
|
@ -3,7 +3,10 @@ package utilService |
|
|
|
import ( |
|
|
|
"GoClouds/core/cloud/userCloud" |
|
|
|
"GoClouds/models" |
|
|
|
"fmt" |
|
|
|
"github.com/gin-gonic/gin" |
|
|
|
ruisUtil "github.com/mgr9525/go-ruisutil" |
|
|
|
"net/http" |
|
|
|
) |
|
|
|
|
|
|
|
const LgUserKey = "mid-lguser" |
|
|
@ -30,3 +33,15 @@ func GetMidLgUser(c *gin.Context) *models.SysUser { |
|
|
|
} |
|
|
|
return lguser |
|
|
|
} |
|
|
|
func MidNotFound404(c *gin.Context) { |
|
|
|
c.Next() |
|
|
|
if c.Writer.Status() == http.StatusNotFound && c.Writer.Size() <= 0 { |
|
|
|
data := ruisUtil.Map{} |
|
|
|
data["msg"] = "未找到页面!正在跳转。。。" |
|
|
|
msg, ok := c.Get("404msg") |
|
|
|
if ok { |
|
|
|
data["msg"] = fmt.Sprintf("%v", msg) |
|
|
|
} |
|
|
|
c.HTML(http.StatusNotFound, "goto.html", data) |
|
|
|
} |
|
|
|
} |