Browse Source

bugs++

master
LinskRuis.32G 4 years ago
parent
commit
8e0d215a1c
  1. 2
      go.mod
  2. 4
      go.sum
  3. 15
      service/utilService/mids.go

2
go.mod

@ -6,7 +6,7 @@ require (
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/gin-gonic/gin v1.7.1
github.com/go-sql-driver/mysql v1.5.0
github.com/mgr9525/HyperByte-Transfer-Protocol v0.0.0-20210422034730-0b85fcf3afe0
github.com/mgr9525/HyperByte-Transfer-Protocol v0.0.0-20210426153421-56963f4775c8
github.com/mgr9525/go-cloud v1.0.6-0.20210425153348-0292a9ccd8f8
github.com/mgr9525/go-ruisutil v1.0.8-0.20210317093428-f69295935056
github.com/qiniu/qmgo v0.9.2

4
go.sum

@ -97,8 +97,8 @@ github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHX
github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU=
github.com/mattn/go-sqlite3 v1.14.0 h1:mLyGNKR8+Vv9CAU7PphKa2hkEqxxhn8i32J6FPj1/QA=
github.com/mattn/go-sqlite3 v1.14.0/go.mod h1:JIl7NbARA7phWnGvh0LKTyg7S9BA+6gx71ShQilpsus=
github.com/mgr9525/HyperByte-Transfer-Protocol v0.0.0-20210422034730-0b85fcf3afe0 h1:pnIfNO1DHHY5QSTZZD6bIJa2yDoI+saVY4YaQd8EdA8=
github.com/mgr9525/HyperByte-Transfer-Protocol v0.0.0-20210422034730-0b85fcf3afe0/go.mod h1:U2OZ06VD1PHu3ZLZ8tuEHooaOZnoke/4ZKAZfL44bUQ=
github.com/mgr9525/HyperByte-Transfer-Protocol v0.0.0-20210426153421-56963f4775c8 h1:0H1rZNOJEAuidzG5KNIwylLS8cukGRrg7VfGI474lbQ=
github.com/mgr9525/HyperByte-Transfer-Protocol v0.0.0-20210426153421-56963f4775c8/go.mod h1:U2OZ06VD1PHu3ZLZ8tuEHooaOZnoke/4ZKAZfL44bUQ=
github.com/mgr9525/go-cloud v1.0.6-0.20210425153348-0292a9ccd8f8 h1:0OloknN3axz+XuBpc6OpTtVIlCE2GoUhvS3NP4tc354=
github.com/mgr9525/go-cloud v1.0.6-0.20210425153348-0292a9ccd8f8/go.mod h1:VkCKgivVD2OX75Zwh+AO3zuJyxGCsuo0zdy+UXCYy9I=
github.com/mgr9525/go-ruisutil v1.0.8-0.20210317093428-f69295935056 h1:JhXsFUB3mFWwiDc8c//E/6cUazJUX1lIiLgiM0asNjA=

15
service/utilService/mids.go

@ -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)
}
}
Loading…
Cancel
Save