diff --git a/core/cloud/userCloud/user.go b/core/cloud/userCloud/user.go index 1b9e88d..d505c3f 100644 --- a/core/cloud/userCloud/user.go +++ b/core/cloud/userCloud/user.go @@ -21,7 +21,11 @@ func CurrUser(c *gin.Context) *models.SysUser { if tkm == nil { return nil } - xid := fmt.Sprintf("%v", tkm["xid"]) + t, ok := tkm["xid"] + if !ok { + return nil + } + xid := fmt.Sprintf("%v", t) if xid == "" { return nil } diff --git a/go.mod b/go.mod index 1b32217..2363b0e 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( 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-20210428085206-8dfaf346081f - github.com/mgr9525/go-cloud v1.0.6-0.20210425153348-0292a9ccd8f8 + github.com/mgr9525/go-cloud v1.0.6-0.20210430095501-3deefe12e854 github.com/mgr9525/go-ruisutil v1.0.8-0.20210317093428-f69295935056 github.com/qiniu/qmgo v0.9.2 github.com/sirupsen/logrus v1.8.1 diff --git a/go.sum b/go.sum index 0d16e62..47336b8 100644 --- a/go.sum +++ b/go.sum @@ -97,20 +97,10 @@ 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-20210426153421-56963f4775c8 h1:0H1rZNOJEAuidzG5KNIwylLS8cukGRrg7VfGI474lbQ= -github.com/mgr9525/HyperByte-Transfer-Protocol v0.0.0-20210426153421-56963f4775c8/go.mod h1:U2OZ06VD1PHu3ZLZ8tuEHooaOZnoke/4ZKAZfL44bUQ= -github.com/mgr9525/HyperByte-Transfer-Protocol v0.0.0-20210428064104-cf9d03801c90 h1:L9XcJd4EtXJlAOL4mTbFCOtA/I8wCUiGFvT4EV/ftkQ= -github.com/mgr9525/HyperByte-Transfer-Protocol v0.0.0-20210428064104-cf9d03801c90/go.mod h1:U2OZ06VD1PHu3ZLZ8tuEHooaOZnoke/4ZKAZfL44bUQ= -github.com/mgr9525/HyperByte-Transfer-Protocol v0.0.0-20210428065711-bd49ee675caf h1:thhSwQ/vGaKwfjtfAQkzvIOalS1qdO744fycNGGAMyE= -github.com/mgr9525/HyperByte-Transfer-Protocol v0.0.0-20210428065711-bd49ee675caf/go.mod h1:U2OZ06VD1PHu3ZLZ8tuEHooaOZnoke/4ZKAZfL44bUQ= -github.com/mgr9525/HyperByte-Transfer-Protocol v0.0.0-20210428071134-d17a92cd6e53 h1:OSD3MNKWw1Cg5SDf9cJ4C2ykzkwWfKL4nI2hsWL9qN0= -github.com/mgr9525/HyperByte-Transfer-Protocol v0.0.0-20210428071134-d17a92cd6e53/go.mod h1:U2OZ06VD1PHu3ZLZ8tuEHooaOZnoke/4ZKAZfL44bUQ= -github.com/mgr9525/HyperByte-Transfer-Protocol v0.0.0-20210428072149-37ef706dc11f h1:LeHvOXTRUGaVRpNl0KWCh/dKrLgsqhR/R/gzkOBxW8A= -github.com/mgr9525/HyperByte-Transfer-Protocol v0.0.0-20210428072149-37ef706dc11f/go.mod h1:U2OZ06VD1PHu3ZLZ8tuEHooaOZnoke/4ZKAZfL44bUQ= github.com/mgr9525/HyperByte-Transfer-Protocol v0.0.0-20210428085206-8dfaf346081f h1:LWtr7NrrPqDUAU4Z4MJFHkLpVUSidZwZ/Oo2h+JYEDw= github.com/mgr9525/HyperByte-Transfer-Protocol v0.0.0-20210428085206-8dfaf346081f/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-cloud v1.0.6-0.20210430095501-3deefe12e854 h1:4BE3FDyS3ahkSu/sHH+rQitLyM0ykSk1kOz7j7QEal8= +github.com/mgr9525/go-cloud v1.0.6-0.20210430095501-3deefe12e854/go.mod h1:VkCKgivVD2OX75Zwh+AO3zuJyxGCsuo0zdy+UXCYy9I= github.com/mgr9525/go-ruisutil v1.0.8-0.20210317093428-f69295935056 h1:JhXsFUB3mFWwiDc8c//E/6cUazJUX1lIiLgiM0asNjA= github.com/mgr9525/go-ruisutil v1.0.8-0.20210317093428-f69295935056/go.mod h1:qXUWVKpHdwoxR0KERCkvL1JH2DETY6b5TMG9t6g9Pls= github.com/mgr9525/logrus-file-hook v0.0.0-20210315103109-42681d084c3b h1:sGrxWDbhC2XpDKOLdNrYVo3Ga9YIFMr0AfjnP2gli0o=