code refactor

This commit is contained in:
MaysWind
2020-12-23 01:24:44 +08:00
parent 62ef7cbcbe
commit b3962e8af9
35 changed files with 256 additions and 255 deletions
+2 -2
View File
@@ -314,8 +314,8 @@ func (s *TokenService) getUserAgent(ctx *core.Context) string {
userAgent = ctx.Request.UserAgent()
}
if len(userAgent) > models.TOKEN_USER_AGENT_MAX_LENGTH {
userAgent = utils.SubString(userAgent, 0, models.TOKEN_USER_AGENT_MAX_LENGTH)
if len(userAgent) > models.TokenMaxUserAgentLength {
userAgent = utils.SubString(userAgent, 0, models.TokenMaxUserAgentLength)
}
return userAgent