任务三

This commit is contained in:
Yvan
2026-01-07 14:50:58 +08:00
parent 1a06053b30
commit c83b773a40
6 changed files with 263 additions and 103 deletions
+8
View File
@@ -154,3 +154,11 @@ func GetAuthorityID(ctx context.Context) uint {
}
return 0
}
// GetToken 从context获取token
func GetToken(ctx context.Context) string {
if tr, ok := transport.FromServerContext(ctx); ok {
return extractToken(tr)
}
return ""
}