Skip to content
This repository was archived by the owner on Nov 11, 2024. It is now read-only.

Commit a40ac14

Browse files
committedMar 14, 2019
update
1 parent d62f2e5 commit a40ac14

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed
 

‎README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ import (
4141
)
4242

4343
type Default struct {
44-
GinJWTMiddleware *jwt.GinJWTMiddleware
44+
GfJWTMiddleware *jwt.GfJWTMiddleware
4545
Rules map[string]string
4646
}
4747

4848
func (d *Default) Init() {
49-
authMiddleware, err := jwt.New(&jwt.GinJWTMiddleware{
49+
authMiddleware, err := jwt.New(&jwt.GfJWTMiddleware{
5050
Realm: "test zone",
5151
Key: []byte("secret key"),
5252
Timeout: time.Minute * 5,
@@ -65,7 +65,7 @@ func (d *Default) Init() {
6565
if err != nil {
6666
log.Fatal("JWT Error:" + err.Error())
6767
}
68-
d.GinJWTMiddleware = authMiddleware
68+
d.GfJWTMiddleware = authMiddleware
6969
d.Rules = map[string]string{
7070
"username": "required",
7171
"password": "required",
@@ -128,7 +128,6 @@ func (d *Default) Authenticator(r *ghttp.Request) (interface{}, error) {
128128

129129
return nil, jwt.ErrFailedAuthentication
130130
}
131-
132131
```
133132

134133
## Demo

‎README_zh.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# gf-jwt
22
gf 的 jwt 插件
33

4-
这个插件是 fork 了 [https://github.com/appleboy/gin-jwt](https://github.com/appleboy/gin-jwt) 插件,修改为 [https://github.com/gogf/gf](https://github.com/gogf/gf) 插件.
4+
这个插件是 fork 了 [https://github.com/appleboy/gin-jwt](https://github.com/appleboy/gin-jwt) 插件,修改为 [https://github.com/gogf/gf](https://github.com/gogf/gf) 插件.
55

66

77
[英文](README.md) [中文](README_zh.md)
@@ -41,12 +41,12 @@ import (
4141
)
4242

4343
type Default struct {
44-
GinJWTMiddleware *jwt.GinJWTMiddleware
44+
GfJWTMiddleware *jwt.GfJWTMiddleware
4545
Rules map[string]string
4646
}
4747

4848
func (d *Default) Init() {
49-
authMiddleware, err := jwt.New(&jwt.GinJWTMiddleware{
49+
authMiddleware, err := jwt.New(&jwt.GfJWTMiddleware{
5050
Realm: "test zone",
5151
Key: []byte("secret key"),
5252
Timeout: time.Minute * 5,
@@ -65,7 +65,7 @@ func (d *Default) Init() {
6565
if err != nil {
6666
log.Fatal("JWT Error:" + err.Error())
6767
}
68-
d.GinJWTMiddleware = authMiddleware
68+
d.GfJWTMiddleware = authMiddleware
6969
d.Rules = map[string]string{
7070
"username": "required",
7171
"password": "required",
@@ -128,7 +128,6 @@ func (d *Default) Authenticator(r *ghttp.Request) (interface{}, error) {
128128

129129
return nil, jwt.ErrFailedAuthentication
130130
}
131-
132131
```
133132

134133
## Demo

0 commit comments

Comments
 (0)
This repository has been archived.