Browse Source

Update auth.go, change int to int64

lily-lee 6 years ago
parent
commit
7b63f10703
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      middleware/auth/auth.go
  2. 1
    1
      middleware/auth/optional_auth.go

+ 1
- 1
middleware/auth/auth.go View File

63
 			}
63
 			}
64
 
64
 
65
 			if uid, ok := mapClaims[CtxRequestHeaderUserId].(float64); ok {
65
 			if uid, ok := mapClaims[CtxRequestHeaderUserId].(float64); ok {
66
-				ctx.Set(CtxRequestHeaderUserId, int(uid))
66
+				ctx.Set(CtxRequestHeaderUserId, int64(uid))
67
 			}
67
 			}
68
 		}
68
 		}
69
 	}
69
 	}

+ 1
- 1
middleware/auth/optional_auth.go View File

51
 			}
51
 			}
52
 
52
 
53
 			if uid, ok := mapClaims[CtxRequestHeaderUserId].(float64); ok {
53
 			if uid, ok := mapClaims[CtxRequestHeaderUserId].(float64); ok {
54
-				ctx.Set(CtxRequestHeaderUserId, int(uid))
54
+				ctx.Set(CtxRequestHeaderUserId, int64(uid))
55
 			}
55
 			}
56
 		}
56
 		}
57
 	}
57
 	}