Skip to content

Commit

Permalink
update gf 1.11.2
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangbiao committed Jan 13, 2020
1 parent e4a7944 commit c9a67ab
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 18 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
Change Log 更新说明
------------------------------
## 2020-01-13 v1.3.10
1. gf升级为V1.11.2,修改即将废弃函数

## 2019-12-20 v1.3.9
1. gf升级为V1.10.1,适配时间格式兼容性修改

Expand Down
4 changes: 2 additions & 2 deletions example/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ func initRouter() {
}

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 == "" {
r.Response.WriteJson(gtoken.Fail("账号或密码错误."))
Expand Down
15 changes: 6 additions & 9 deletions example/test/time_test.go
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
package test

import (
"github.com/gogf/gf/os/gtime"
"github.com/gogf/gf/util/gconv"
"testing"
"time"
)

func TestTime(t *testing.T) {
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))
//}

}
5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
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
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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/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.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/gomodule/redigo v2.0.0+incompatible h1:K/R+8tc58AaqLkqG2Ol3Qk+DR/TlNuhuh457pBFPtt0=
github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4=
Expand Down
6 changes: 3 additions & 3 deletions gtoken/gtoken.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,13 @@ func (m *GfToken) Init() bool {
if r.Method == "GET" {
params = r.GetQueryMap()
} else if r.Method == "POST" {
params = r.GetPostMap()
params = r.GetQueryMap()
} else {
r.Response.Writeln("Request Method is ERROR! ")
return
}

no := gconv.String(gtime.Millisecond())
no := gconv.String(gtime.TimestampMilli())

glog.Info(fmt.Sprintf("[AUTH_%s][url:%s][params:%s][data:%s]",
no, r.URL.Path, params, respData.Json()))
Expand Down Expand Up @@ -292,7 +292,7 @@ func (m *GfToken) getRequestToken(r *ghttp.Request) Resp {
return Succ(parts[1])
}

authHeader = r.GetPostString("token")
authHeader = r.GetString("token")
if authHeader == "" {
return Unauthorized("query token fail", "")
}
Expand Down

0 comments on commit c9a67ab

Please sign in to comment.