|
@@ -37,16 +37,6 @@ var (
|
|
|
CHART_INDEX_NAME string
|
|
|
)
|
|
|
|
|
|
-
|
|
|
-var (
|
|
|
-
|
|
|
- EDB_LIB_URL string
|
|
|
- APP_EDB_LIB_NAME_EN string
|
|
|
- EDB_LIB_Md5_KEY string
|
|
|
- OpUserId int
|
|
|
- OpUserRealName string
|
|
|
-)
|
|
|
-
|
|
|
|
|
|
const (
|
|
|
APPID = "SJCrpOPvagscPxEv"
|
|
@@ -66,15 +56,6 @@ var (
|
|
|
LogMaxDays int
|
|
|
)
|
|
|
|
|
|
-var (
|
|
|
- EtaBridgeUrl string
|
|
|
- EtaBridgeAppNameEn string
|
|
|
- EtaBridgeMd5Key string
|
|
|
- EtaBridgeDesKey string
|
|
|
- SyncUserPath string
|
|
|
- SyncIndexPath string
|
|
|
-)
|
|
|
-
|
|
|
|
|
|
var (
|
|
|
ETA_FORUM_HUB_URL string
|
|
@@ -92,6 +73,22 @@ func init() {
|
|
|
}
|
|
|
RunMode = tmpRunMode
|
|
|
fmt.Println("RunMode:", RunMode)
|
|
|
+ if RunMode == "" {
|
|
|
+ localIp, err := GetLocalIP()
|
|
|
+ fmt.Println("localIp:", localIp)
|
|
|
+ if localIp == "10.0.0.123" {
|
|
|
+ RunMode = "debug"
|
|
|
+ } else {
|
|
|
+ RunMode = "release"
|
|
|
+ }
|
|
|
+ fmt.Println("RunMode:", RunMode)
|
|
|
+ configPath := `/home/code/config/eta_forum_task/conf/app.conf`
|
|
|
+ fmt.Println("configPath:", configPath)
|
|
|
+ err = web.LoadAppConfig("ini", configPath)
|
|
|
+ if err != nil {
|
|
|
+ fmt.Println("web.LoadAppConfig Err:" + err.Error())
|
|
|
+ }
|
|
|
+ }
|
|
|
config, err := web.AppConfig.GetSection(RunMode)
|
|
|
if err != nil {
|
|
|
panic("配置文件读取错误 " + err.Error())
|
|
@@ -111,21 +108,6 @@ func init() {
|
|
|
|
|
|
MgoUrlData = config["mgo_url_data"]
|
|
|
|
|
|
-
|
|
|
- {
|
|
|
-
|
|
|
- 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"]
|
|
|
- opUserIdStr := config["op_user_id"]
|
|
|
- if opUserIdStr != `` {
|
|
|
- OpUserId, err = strconv.Atoi(opUserIdStr)
|
|
|
- if err != nil {
|
|
|
- panic("配置文件中操作人配置错误 " + err.Error())
|
|
|
- }
|
|
|
- }
|
|
|
- OpUserRealName = config["op_user_real_name"]
|
|
|
- }
|
|
|
|
|
|
{
|
|
|
LogPath = config["log_path"]
|