chore: extract jwt from server to api

This commit is contained in:
Steven
2023-06-24 13:58:38 +08:00
parent c4388fb211
commit 0a811d2568
8 changed files with 41 additions and 48 deletions

13
internal/util/util.go Normal file
View File

@ -0,0 +1,13 @@
package util
import "strings"
// HasPrefixes returns true if the string s has any of the given prefixes.
func HasPrefixes(src string, prefixes ...string) bool {
for _, prefix := range prefixes {
if strings.HasPrefix(src, prefix) {
return true
}
}
return false
}