middleware/user.go | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
middleware/user.go
@@ -32,7 +32,15 @@ } } var whiteList = map[string]struct{}{ //白名单地址列表 "/api/code/getCodeList": {}, "/api/data/getAllData": {}, } func CheckAuth(apiPath string, token string) bool { if _, ok := whiteList[apiPath]; ok { return true } cli := user.NewUserServiceClient(userConn) ctx, cancel := context.WithTimeout(context.Background(), time.Second) defer cancel()