diff --git a/internal/dao/search/meili.go b/internal/dao/search/meili.go index 07c9928d..4c6a65c7 100644 --- a/internal/dao/search/meili.go +++ b/internal/dao/search/meili.go @@ -103,7 +103,7 @@ func (s *meiliTweetSearchServant) queryByContent(user *core.User, q *core.QueryR request := &meilisearch.SearchRequest{ Offset: int64(offset), Limit: int64(limit), - Sort: []string{"is_top:desc", "-upvote_count", "-collection_count", "latest_replied_on:desc"}, + Sort: []string{"is_top:desc", "upvote_count:desc", "collection_count:desc", "latest_replied_on:desc"}, } filter := s.filterList(user) diff --git a/internal/dao/search/zinc.go b/internal/dao/search/zinc.go index c0fc6dab..67b33a0b 100644 --- a/internal/dao/search/zinc.go +++ b/internal/dao/search/zinc.go @@ -101,7 +101,7 @@ func (s *zincTweetSearchServant) queryByContent(user *core.User, q *core.QueryRe "content": q.Query, }, }, - "sort": []string{"is_top:desc", "-upvote_count", "-collection_count", "-latest_replied_on"}, + "sort": []string{"-is_top", "-upvote_count", "-collection_count", "-latest_replied_on"}, "from": offset, "size": limit, }) diff --git a/internal/servants/web/alipay.go b/internal/servants/web/alipay.go index 2a007475..5e189b84 100644 --- a/internal/servants/web/alipay.go +++ b/internal/servants/web/alipay.go @@ -97,7 +97,7 @@ func (s *alipayPrivSrv) UserRechargeLink(req *web.UserRechargeLinkReq) (*web.Use p.TotalAmount = fmt.Sprintf("%.2f", float64(recharge.Amount)/100.0*a) //p.NotifyURL = "http://" + req.Host + "/v1/alipay/notify" //支付宝回调,如果是内网环境的话,需要增加内网穿透 - p.NotifyURL = "http://5tc4bf.natappfree.cc/v1/alipay/notify" + p.NotifyURL = "http://uszkjc.natappfree.cc/v1/alipay/notify" rsp, err := s.alipayClient.TradePreCreate(p) if err != nil { logrus.Errorf("client.TradePreCreate err: %v\n", err) diff --git a/internal/servants/web/pub.go b/internal/servants/web/pub.go index 5314b9b0..ff94cfd6 100644 --- a/internal/servants/web/pub.go +++ b/internal/servants/web/pub.go @@ -11,6 +11,7 @@ import ( "image/color" "image/png" "regexp" + "time" "unicode/utf8" "github.com/afocus/captcha" @@ -132,6 +133,9 @@ func (s *pubSrv) Register(req *web.RegisterReq) (*web.RegisterResp, mir.Error) { } password, salt := encryptPasswordAndSalt(req.Password) //password, salt := encryptPasswordAndSalt(req.Password, req.Username) + //当前时间戳加15天 + balance := time.Now().AddDate(0, 0, 15).Unix() + user := &core.User{ Nickname: req.Username, Username: req.Username, @@ -139,6 +143,7 @@ func (s *pubSrv) Register(req *web.RegisterReq) (*web.RegisterResp, mir.Error) { Avatar: getRandomAvatar(), Salt: salt, Status: core.UserStatusNormal, + Balance: balance, } user, err := s.Ds.CreateUser(user) if err != nil { diff --git a/web/src/views/Wallet.vue b/web/src/views/Wallet.vue index c03e8b72..b2bb9008 100644 --- a/web/src/views/Wallet.vue +++ b/web/src/views/Wallet.vue @@ -181,7 +181,7 @@ const openAmounts = ref([3000,18500,36500]); const timecal = (timestamp: number) => { const timestampInSeconds = Math.floor(Date.now() / 1000); const timeDifference = timestamp - timestampInSeconds; - const days = Math.floor(timeDifference / (24 * 3600)); + const days = Math.floor(timeDifference / (24 * 3600)) + 1; return Math.max(0, days); // 确保返回值不会是负数 }; ////获取时间差