Skip to content

Commit

Permalink
Fix:命中缓存,返回状态码错误
Browse files Browse the repository at this point in the history
  • Loading branch information
CareyWang committed Feb 12, 2020
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
Expand Up @@ -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
Expand Down

0 comments on commit 37fa060

Please sign in to comment.