添加闲麦接口域名配置
This commit is contained in:
parent
a668ee2b9d
commit
687b41ecb1
|
@ -62,6 +62,7 @@ type config struct {
|
||||||
|
|
||||||
//LotteryHost string
|
//LotteryHost string
|
||||||
//LotteryPort int
|
//LotteryPort int
|
||||||
|
XianMaiBaseUrl string
|
||||||
}
|
}
|
||||||
|
|
||||||
var AppConfig config
|
var AppConfig config
|
||||||
|
@ -148,10 +149,11 @@ func initConfig() {
|
||||||
SmsSignName: viper.GetString("sms.sign_name"),
|
SmsSignName: viper.GetString("sms.sign_name"),
|
||||||
SmsTemplateCode: viper.GetString("sms.template_code"),
|
SmsTemplateCode: viper.GetString("sms.template_code"),
|
||||||
|
|
||||||
RedisHost: viper.GetString("redis.host"),
|
RedisHost: viper.GetString("redis.host"),
|
||||||
RedisPort: viper.GetInt("redis.port"),
|
RedisPort: viper.GetInt("redis.port"),
|
||||||
RedisPassword: viper.GetString("redis.password"),
|
RedisPassword: viper.GetString("redis.password"),
|
||||||
RedisDB: viper.GetInt("redis.db"),
|
RedisDB: viper.GetInt("redis.db"),
|
||||||
|
XianMaiBaseUrl: viper.GetString("xianmai_base_url"),
|
||||||
}
|
}
|
||||||
|
|
||||||
//fmt.Printf("%+v", AppConfig)
|
//fmt.Printf("%+v", AppConfig)
|
||||||
|
|
|
@ -2,6 +2,7 @@ package xianmai
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/codinl/go-logger"
|
"github.com/codinl/go-logger"
|
||||||
|
"mh-server/config"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -270,7 +271,7 @@ func (m *SmExternal) EoPulling(resp interface{}) error {
|
||||||
}
|
}
|
||||||
sanMaiClient = &SanMaiClient{
|
sanMaiClient = &SanMaiClient{
|
||||||
Authentication: maiToken,
|
Authentication: maiToken,
|
||||||
BaseURL: SmBaseURL,
|
BaseURL: config.AppConfig.XianMaiBaseUrl,
|
||||||
}
|
}
|
||||||
|
|
||||||
err = sanMaiClient.post(m.ApiRoute, m.ParaMap, resp)
|
err = sanMaiClient.post(m.ApiRoute, m.ParaMap, resp)
|
||||||
|
|
|
@ -8,6 +8,7 @@ import (
|
||||||
"github.com/codinl/go-logger"
|
"github.com/codinl/go-logger"
|
||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"mh-server/config"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
@ -187,7 +188,7 @@ type SanMaiClient struct {
|
||||||
|
|
||||||
const (
|
const (
|
||||||
SmBaseURL = "https://testh5.xianmai.net.cn"
|
SmBaseURL = "https://testh5.xianmai.net.cn"
|
||||||
//SmBaseURL = "https://xianmai.net.cn/"
|
//SmBaseURL = "https://www.xianmai.net.cn"
|
||||||
)
|
)
|
||||||
|
|
||||||
var sanMaiClient *SanMaiClient
|
var sanMaiClient *SanMaiClient
|
||||||
|
@ -199,7 +200,7 @@ func GetSanMaiClient() *SanMaiClient {
|
||||||
fmt.Println("初始化数据")
|
fmt.Println("初始化数据")
|
||||||
sanMaiClient = &SanMaiClient{
|
sanMaiClient = &SanMaiClient{
|
||||||
Authentication: SanMaiToken(),
|
Authentication: SanMaiToken(),
|
||||||
BaseURL: SmBaseURL,
|
BaseURL: config.AppConfig.XianMaiBaseUrl,
|
||||||
ExpireTime: nowTime.AddDate(0, 0, 1),
|
ExpireTime: nowTime.AddDate(0, 0, 1),
|
||||||
}
|
}
|
||||||
return sanMaiClient
|
return sanMaiClient
|
||||||
|
@ -217,7 +218,7 @@ func SanMaiToken() string {
|
||||||
}
|
}
|
||||||
sanMaiClient = &SanMaiClient{
|
sanMaiClient = &SanMaiClient{
|
||||||
Authentication: "",
|
Authentication: "",
|
||||||
BaseURL: SmBaseURL,
|
BaseURL: config.AppConfig.XianMaiBaseUrl,
|
||||||
}
|
}
|
||||||
|
|
||||||
resp := &SubmitLoginApiResp{}
|
resp := &SubmitLoginApiResp{}
|
||||||
|
@ -245,7 +246,7 @@ func EoSanMaiToken(wechatId, wechatMobile, requestType string) (string, error) {
|
||||||
}
|
}
|
||||||
sanMaiClient = &SanMaiClient{
|
sanMaiClient = &SanMaiClient{
|
||||||
Authentication: "",
|
Authentication: "",
|
||||||
BaseURL: SmBaseURL,
|
BaseURL: config.AppConfig.XianMaiBaseUrl,
|
||||||
}
|
}
|
||||||
|
|
||||||
resp := &SubmitLoginApiResp{}
|
resp := &SubmitLoginApiResp{}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user