diff --git a/internal/controller/user/user.go b/internal/controller/user/user.go deleted file mode 100644 index 8220c1a..0000000 --- a/internal/controller/user/user.go +++ /dev/null @@ -1,5 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package user diff --git a/internal/controller/user/user_new.go b/internal/controller/user/user_new.go deleted file mode 100644 index f54941d..0000000 --- a/internal/controller/user/user_new.go +++ /dev/null @@ -1,15 +0,0 @@ -// ================================================================================= -// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish. -// ================================================================================= - -package user - -import ( - "server/api/user" -) - -type ControllerV1 struct{} - -func NewV1() user.IUserV1 { - return &ControllerV1{} -} diff --git a/internal/controller/user/user_v1_info.go b/internal/controller/user/user_v1_info.go deleted file mode 100644 index ff1237f..0000000 --- a/internal/controller/user/user_v1_info.go +++ /dev/null @@ -1,14 +0,0 @@ -package user - -import ( - "context" - - "github.com/gogf/gf/v2/errors/gcode" - "github.com/gogf/gf/v2/errors/gerror" - - "server/api/user/v1" -) - -func (c *ControllerV1) Info(ctx context.Context, req *v1.InfoReq) (res *v1.InfoRes, err error) { - return nil, gerror.NewCode(gcode.CodeNotImplemented) -} diff --git a/internal/controller/user/user_v1_list.go b/internal/controller/user/user_v1_list.go deleted file mode 100644 index fc9b376..0000000 --- a/internal/controller/user/user_v1_list.go +++ /dev/null @@ -1,14 +0,0 @@ -package user - -import ( - "context" - - "github.com/gogf/gf/v2/errors/gcode" - "github.com/gogf/gf/v2/errors/gerror" - - "server/api/user/v1" -) - -func (c *ControllerV1) List(ctx context.Context, req *v1.ListReq) (res *v1.ListRes, err error) { - return nil, gerror.NewCode(gcode.CodeNotImplemented) -} diff --git a/internal/middleware/auth.go b/internal/middleware/auth.go index 8c8c86a..7c51cfd 100644 --- a/internal/middleware/auth.go +++ b/internal/middleware/auth.go @@ -40,7 +40,7 @@ func Auth(r *ghttp.Request) { if err != nil { Exit(r, err) } - r.SetCtxVar("userId", tokenOut.UserId) + r.SetCtxVar("id", tokenOut.UserId) r.SetCtxVar("role", tokenOut.Role) r.SetCtxVar("jti", tokenOut.JTI) }