|
@@ -1,6 +1,7 @@
|
|
|
package utils
|
|
|
|
|
|
import (
|
|
|
+ "encoding/json"
|
|
|
"fmt"
|
|
|
beego "github.com/beego/beego/v2/adapter"
|
|
|
"github.com/beego/beego/v2/server/web"
|
|
@@ -42,10 +43,15 @@ var (
|
|
|
// 经济数据库
|
|
|
var (
|
|
|
EDB_LIB_URL string
|
|
|
+ EDB_LIB_URL_LIST []EtaLibUrlList
|
|
|
APP_EDB_LIB_NAME_EN string
|
|
|
EDB_LIB_Md5_KEY string
|
|
|
)
|
|
|
|
|
|
+type EtaLibUrlList struct {
|
|
|
+ Url string
|
|
|
+}
|
|
|
+
|
|
|
// 公共数据服务接口参数
|
|
|
var (
|
|
|
APPID string
|
|
@@ -236,6 +242,14 @@ func init() {
|
|
|
EDB_LIB_URL = config["edb_lib_url"]
|
|
|
APP_EDB_LIB_NAME_EN = config["app_edb_lib_name_en"]
|
|
|
EDB_LIB_Md5_KEY = config["edb_lib_md5_key"]
|
|
|
+ if EDB_LIB_URL == "" {
|
|
|
+ EDB_LIB_URL = "http://127.0.0.1:8300/edbapi/"
|
|
|
+ } else {
|
|
|
+ err = json.Unmarshal([]byte(EDB_LIB_URL), &EDB_LIB_URL_LIST)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println("eta_lib_url 配置错误,请检查,Err:" + err.Error())
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
APPID = config["appid"]
|