We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
中间件的代码里只是验证的 token 是否有效,但是没取到用户是谁,这个在控制器里怎么取到?
The text was updated successfully, but these errors were encountered:
中间件里:
return func(c *gin.Context) { c.Set("uid", res.Id) }
放在gin.Context里,用的时候:
c.GetInt("uid")
Sorry, something went wrong.
No branches or pull requests
中间件的代码里只是验证的 token 是否有效,但是没取到用户是谁,这个在控制器里怎么取到?
The text was updated successfully, but these errors were encountered: