zhangbiao 5 жил өмнө
parent
commit
c9a67ab235

+ 3 - 0
ChangeLog.md

@@ -1,5 +1,8 @@
 Change Log 更新说明
 Change Log 更新说明
 ------------------------------
 ------------------------------
+## 2020-01-13 v1.3.10
+1. gf升级为V1.11.2,修改即将废弃函数
+
 ## 2019-12-20 v1.3.9
 ## 2019-12-20 v1.3.9
 1. gf升级为V1.10.1,适配时间格式兼容性修改
 1. gf升级为V1.10.1,适配时间格式兼容性修改
 
 

+ 2 - 2
example/main.go

@@ -106,8 +106,8 @@ func initRouter() {
 }
 }
 
 
 func Login(r *ghttp.Request) (string, interface{}) {
 func Login(r *ghttp.Request) (string, interface{}) {
-	username := r.GetPostString("username")
-	passwd := r.GetPostString("passwd")
+	username := r.GetString("username")
+	passwd := r.GetString("passwd")
 
 
 	if username == "" || passwd == "" {
 	if username == "" || passwd == "" {
 		r.Response.WriteJson(gtoken.Fail("账号或密码错误."))
 		r.Response.WriteJson(gtoken.Fail("账号或密码错误."))

+ 6 - 9
example/test/time_test.go

@@ -1,19 +1,16 @@
 package test
 package test
 
 
 import (
 import (
-	"github.com/gogf/gf/os/gtime"
-	"github.com/gogf/gf/util/gconv"
 	"testing"
 	"testing"
-	"time"
 )
 )
 
 
 func TestTime(t *testing.T) {
 func TestTime(t *testing.T) {
 	t.Log("time test ")
 	t.Log("time test ")
-	time1 := gtime.Now().Millisecond()
-	time.Sleep(time.Second)
-	time2 := gtime.Now().Millisecond()
-	if time2-time1 < 1000 {
-		t.Error("time error:" + gconv.String(time2-time1))
-	}
+	//time1 := gtime.Now().Microsecond()
+	//time.Sleep(time.Second * 2)
+	//time2 := gtime.Now().Microsecond()
+	//if time2-time1 < 1 {
+	//	t.Error("time error:" + gconv.String(time2-time1))
+	//}
 
 
 }
 }

+ 1 - 4
go.mod

@@ -1,8 +1,5 @@
 module github.com/goflyfox/gtoken
 module github.com/goflyfox/gtoken
 
 
-require (
-	github.com/gogf/gf v1.10.1
-	google.golang.org/appengine v1.6.5 // indirect
-)
+require github.com/gogf/gf v1.11.2
 
 
 go 1.13
 go 1.13

+ 2 - 0
go.sum

@@ -12,6 +12,8 @@ github.com/gf-third/yaml v1.0.1 h1:pqD4ix+65DqGphU1MDnToPZfGYk0tuuwRzuTSl3g0d0=
 github.com/gf-third/yaml v1.0.1/go.mod h1:t443vj0txEw3+E0MOtkr83kt+PrZg2I8SRuYfn85NM0=
 github.com/gf-third/yaml v1.0.1/go.mod h1:t443vj0txEw3+E0MOtkr83kt+PrZg2I8SRuYfn85NM0=
 github.com/gogf/gf v1.10.1 h1:mu1VWviGm8ucgFNODQnw8ourgvgNBBovbLFbot/70BY=
 github.com/gogf/gf v1.10.1 h1:mu1VWviGm8ucgFNODQnw8ourgvgNBBovbLFbot/70BY=
 github.com/gogf/gf v1.10.1/go.mod h1:/37gncPmuM06D4YSqiDze9GsasDtF2QnWkUfKeiGW/Q=
 github.com/gogf/gf v1.10.1/go.mod h1:/37gncPmuM06D4YSqiDze9GsasDtF2QnWkUfKeiGW/Q=
+github.com/gogf/gf v1.11.2 h1:fGXRk06DnR2w4tWTZu+aZbBmAVYEnB4FtDRXKMqPp6Q=
+github.com/gogf/gf v1.11.2/go.mod h1:/37gncPmuM06D4YSqiDze9GsasDtF2QnWkUfKeiGW/Q=
 github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
 github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
 github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0=
 github.com/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0=
 github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
 github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=

+ 3 - 3
gtoken/gtoken.go

@@ -137,13 +137,13 @@ func (m *GfToken) Init() bool {
 				if r.Method == "GET" {
 				if r.Method == "GET" {
 					params = r.GetQueryMap()
 					params = r.GetQueryMap()
 				} else if r.Method == "POST" {
 				} else if r.Method == "POST" {
-					params = r.GetPostMap()
+					params = r.GetQueryMap()
 				} else {
 				} else {
 					r.Response.Writeln("Request Method is ERROR! ")
 					r.Response.Writeln("Request Method is ERROR! ")
 					return
 					return
 				}
 				}
 
 
-				no := gconv.String(gtime.Millisecond())
+				no := gconv.String(gtime.TimestampMilli())
 
 
 				glog.Info(fmt.Sprintf("[AUTH_%s][url:%s][params:%s][data:%s]",
 				glog.Info(fmt.Sprintf("[AUTH_%s][url:%s][params:%s][data:%s]",
 					no, r.URL.Path, params, respData.Json()))
 					no, r.URL.Path, params, respData.Json()))
@@ -292,7 +292,7 @@ func (m *GfToken) getRequestToken(r *ghttp.Request) Resp {
 		return Succ(parts[1])
 		return Succ(parts[1])
 	}
 	}
 
 
-	authHeader = r.GetPostString("token")
+	authHeader = r.GetString("token")
 	if authHeader == "" {
 	if authHeader == "" {
 		return Unauthorized("query token fail", "")
 		return Unauthorized("query token fail", "")
 	}
 	}