b 488f38ecc0 1 vor 5 Monaten
..
db 488f38ecc0 1 vor 5 Monaten
example 488f38ecc0 1 vor 5 Monaten
test 488f38ecc0 1 vor 5 Monaten
tool 488f38ecc0 1 vor 5 Monaten
CurrentAuth.go 488f38ecc0 1 vor 5 Monaten
InitGroup.go 488f38ecc0 1 vor 5 Monaten
README.md 488f38ecc0 1 vor 5 Monaten
Singleton.go 488f38ecc0 1 vor 5 Monaten
s.Login.go 488f38ecc0 1 vor 5 Monaten
s.Logout.go 488f38ecc0 1 vor 5 Monaten
s.Middleware.go 488f38ecc0 1 vor 5 Monaten

README.md

jwtx

跨域资源共享 CORS

使用官方 cors 全局中间件,并添加以下必要配置

r.Use(cors.New(cors.Config{

    // 允许跨域请求携带 Authorization 头信息
    AllowMethods:  []string{"OPTIONS"},
    AllowHeaders:  []string{"Authorization"},

    // 允许跨域请求获取 token 响应头
    ExposeHeaders: []string{"token"},
}))