This commit is contained in:
cdle
2021-09-15 19:07:08 +08:00
parent aa3486c7e9
commit 3738ec952b
5 changed files with 33 additions and 7 deletions
-1
View File
@@ -1 +0,0 @@
config.yaml
-3
View File
@@ -1,3 +0,0 @@
host: http://127.0.0.1:5700
client_id:
client_secret:
+4 -1
View File
@@ -22,6 +22,7 @@ type Yaml struct {
}
var Config Yaml
var qinglong = core.NewBucket("qinglong")
var token string
var expiration int64
@@ -39,7 +40,9 @@ type Carrier struct {
}
func init() {
core.ReadYaml(core.ExecPath+"/develop/qinglong/conf/", &Config, "https://raw.githubusercontent.com/cdle/sillyGirl/main/develop/qinglong/conf/demo_config.yaml")
Config.Host = qinglong.Get("host")
Config.ClientID = qinglong.Get("client_id")
Config.ClientSecret = qinglong.Get("client_secret")
if v := regexp.MustCompile(`^(https?://[\.\w]+:?\d*)`).FindStringSubmatch(Config.Host); len(v) == 2 {
Config.Host = v[1]
}