Skip to content

Commit

Permalink
Fix:命中缓存,返回状态码错误
Browse files Browse the repository at this point in the history
CareyWang committed Feb 12, 2020

Verified

This commit was signed with the committer’s verified signature. The key has expired.
fumiya-kume kuu(Fumiya Kume)
1 parent 075c2a9 commit 37fa060
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -77,6 +77,7 @@ func main() {
if 1 == *cache {
_shortUrl, err := redisClient.Get(longUrl).Result()
if err == nil && _shortUrl != "" {
res.Code = 1
res.ShortUrl = _shortUrl
c.JSON(200, res)
return

0 comments on commit 37fa060

Please sign in to comment.