Add nopath for vue things
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"strings"
|
||||
@@ -78,3 +79,23 @@ func GetTimeout() time.Duration {
|
||||
timeout := conf.Get("timeout").GetDuration()
|
||||
return timeout
|
||||
}
|
||||
|
||||
func GetCORS(key string) bool {
|
||||
cors := conf.GetString("cors")
|
||||
var m map[string]bool
|
||||
if err := json.Unmarshal([]byte(cors), &m); err != nil {
|
||||
return false
|
||||
}
|
||||
_, ok := m[key]
|
||||
return ok
|
||||
}
|
||||
|
||||
func GetNoPath(key string) bool {
|
||||
nopath := conf.GetString("nopath")
|
||||
var m map[string]bool
|
||||
if err := json.Unmarshal([]byte(nopath), &m); err != nil {
|
||||
return false
|
||||
}
|
||||
_, ok := m[key]
|
||||
return ok
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user