Merge branch 'master' of new-gitlab.adesk.com:public_project/utility_go
This commit is contained in:
@@ -112,9 +112,24 @@ var (
|
||||
FileUrl: url[v.S3],
|
||||
})
|
||||
if err != nil {
|
||||
Proxy := g.Cfg().MustGet(ctx, "update_proxy", "http://192.168.50.170:10808").String()
|
||||
g.Log().Debugf(ctx, "切换代理进行上传:err=%v", err)
|
||||
get, err = client.Proxy(Proxy).Post(ctx, address+"/callback/update", &UpdateReq{
|
||||
// 读取HTTP代理环境变量(小写/大写通常都兼容,部分系统可能用大写)
|
||||
httpProxy := os.Getenv("http_proxy")
|
||||
if httpProxy == "" {
|
||||
httpProxy = os.Getenv("HTTP_PROXY")
|
||||
}
|
||||
if httpProxy == "" {
|
||||
// 读取HTTPS代理环境变量
|
||||
httpProxy = os.Getenv("https_proxy")
|
||||
if httpProxy == "" {
|
||||
httpProxy = os.Getenv("HTTPS_PROXY")
|
||||
}
|
||||
}
|
||||
// 如果没有读取到本地的代理,使用配置上传
|
||||
if httpProxy == "" {
|
||||
httpProxy = g.Cfg().MustGet(ctx, "update_proxy", "http://192.168.50.173:10808").String()
|
||||
}
|
||||
g.Log().Debugf(ctx, "切换代理进行上传:ip=%v,err=%v", httpProxy, err)
|
||||
get, err = client.Proxy(httpProxy).Post(ctx, address+"/callback/update", &UpdateReq{
|
||||
FileUrl: url[v.S3],
|
||||
})
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@ import (
|
||||
service2 "github.com/ayflying/utility_go/service"
|
||||
"github.com/ayflying/utility_go/tools"
|
||||
"github.com/gogf/gf/v2/container/gset"
|
||||
"github.com/gogf/gf/v2/container/gvar"
|
||||
"github.com/gogf/gf/v2/errors/gerror"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"github.com/gogf/gf/v2/os/gctx"
|
||||
@@ -68,8 +69,8 @@ func (s *sGameAct) Info(uid int64, actId int) (data *g.Var, err error) {
|
||||
Uid: uid,
|
||||
ActId: actId,
|
||||
}).Fields("action").OrderDesc("updated_at").Value()
|
||||
getDb.Scan(&data)
|
||||
|
||||
// getDb.Scan(&data)
|
||||
data = gvar.New(getDb)
|
||||
if data == nil || data.IsEmpty() {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -152,3 +152,8 @@ func (m *timeMod) CheckIsBeRwd(createdTime, lastRwdTime time.Time, _now ...time.
|
||||
// 如果是,则说明还没领过,可以领取
|
||||
return lastRwdTime.Before(refreshToday)
|
||||
}
|
||||
|
||||
// 获取指定时间的本月最后一刻
|
||||
func (m *timeMod) EndOfMonth(t time.Time) time.Time {
|
||||
return time.Date(t.Year(), t.Month()+1, 1, 0, 0, 0, 0, t.Location()).Add(-time.Second)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user