common.go 1.0 KB
package constant

import "os"

const SERVICE_NAME = "partnermg"

var LOG_LEVEL = "debug"
var LOG_File = "./logs/partnermg.log"

var (
	UCENTER_HOST      = "https://suplus-ucenter-test.fjmaimaimai.com" //统一用户中心地址
	UCENTER_SECRET    = "cykbjnfqgctn"
	UCENTER_APP_KEY   = "39aefef9e22744a3b2d2d3791824ae7b"
	UCENTER_CHECK_ALT = "rsF0pL!6DwjBO735"
)

var (
	BUSINESS_ADMIN_HOST = "http://suplus-business-admin-test.fjmaimaimai.com" //企业平台的地址
)

func init() {
	if os.Getenv("LOG_LEVEL") != "" {
		LOG_LEVEL = os.Getenv("LOG_LEVEL")
	}
	if os.Getenv("UCENTER_HOST") != "" {
		UCENTER_HOST = os.Getenv("UCENTER_HOST")
	}
	if os.Getenv("UCENTER_SECRET") != "" {
		UCENTER_SECRET = os.Getenv("UCENTER_SECRET")
	}
	if os.Getenv("UCENTER_APP_KEY") != "" {
		UCENTER_APP_KEY = os.Getenv("UCENTER_APP_KEY")
	}
	if os.Getenv("UCENTER_CHECK_ALT") != "" {
		UCENTER_CHECK_ALT = os.Getenv("UCENTER_CHECK_ALT")
	}
	if os.Getenv("BUSINESS_ADMIN_HOST") != "" {
		BUSINESS_ADMIN_HOST = os.Getenv("BUSINESS_ADMIN_HOST")
	}
}