更新初始订阅时长

pull/361/head
HXY 2 years ago
parent 679d0e401f
commit bbaa84503f

@ -103,7 +103,7 @@ func (s *meiliTweetSearchServant) queryByContent(user *core.User, q *core.QueryR
request := &meilisearch.SearchRequest{ request := &meilisearch.SearchRequest{
Offset: int64(offset), Offset: int64(offset),
Limit: int64(limit), 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) filter := s.filterList(user)

@ -101,7 +101,7 @@ func (s *zincTweetSearchServant) queryByContent(user *core.User, q *core.QueryRe
"content": q.Query, "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, "from": offset,
"size": limit, "size": limit,
}) })

@ -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.TotalAmount = fmt.Sprintf("%.2f", float64(recharge.Amount)/100.0*a)
//p.NotifyURL = "http://" + req.Host + "/v1/alipay/notify" //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) rsp, err := s.alipayClient.TradePreCreate(p)
if err != nil { if err != nil {
logrus.Errorf("client.TradePreCreate err: %v\n", err) logrus.Errorf("client.TradePreCreate err: %v\n", err)

@ -11,6 +11,7 @@ import (
"image/color" "image/color"
"image/png" "image/png"
"regexp" "regexp"
"time"
"unicode/utf8" "unicode/utf8"
"github.com/afocus/captcha" "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)
//password, salt := encryptPasswordAndSalt(req.Password, req.Username) //password, salt := encryptPasswordAndSalt(req.Password, req.Username)
//当前时间戳加15天
balance := time.Now().AddDate(0, 0, 15).Unix()
user := &core.User{ user := &core.User{
Nickname: req.Username, Nickname: req.Username,
Username: req.Username, Username: req.Username,
@ -139,6 +143,7 @@ func (s *pubSrv) Register(req *web.RegisterReq) (*web.RegisterResp, mir.Error) {
Avatar: getRandomAvatar(), Avatar: getRandomAvatar(),
Salt: salt, Salt: salt,
Status: core.UserStatusNormal, Status: core.UserStatusNormal,
Balance: balance,
} }
user, err := s.Ds.CreateUser(user) user, err := s.Ds.CreateUser(user)
if err != nil { if err != nil {

@ -181,7 +181,7 @@ const openAmounts = ref([3000,18500,36500]);
const timecal = (timestamp: number) => { const timecal = (timestamp: number) => {
const timestampInSeconds = Math.floor(Date.now() / 1000); const timestampInSeconds = Math.floor(Date.now() / 1000);
const timeDifference = timestamp - timestampInSeconds; const timeDifference = timestamp - timestampInSeconds;
const days = Math.floor(timeDifference / (24 * 3600)); const days = Math.floor(timeDifference / (24 * 3600)) + 1;
return Math.max(0, days); // 确保返回值不会是负数 return Math.max(0, days); // 确保返回值不会是负数
}; };
////获取时间差 ////获取时间差

Loading…
Cancel
Save