Эх сурвалжийг харах

feat:短地址访问 走数据库配置

wangshan 2 жил өмнө
parent
commit
c1a2ac07f3

+ 0 - 10
src/active.json

@@ -11,16 +11,6 @@
 		"active_Start":1504505600,
 		"active_End":1605024000
 	},
-	"shortUrl":{
-		"introducePage":"https://www.jianyu360.cn/swordfish/SingleLogin?toHref=https%3A%2F%2Fwww.jianyu360.cn%2Fswordfish%2FSingleLogin%3FtoHref%3Dhttps%3A%2F%2Fwww.jianyu360.cn%2Ffront%2Fvipsubscribe%2FintroducePage&title=%E8%B6%85%E7%BA%A7%E8%AE%A2%E9%98%85",
-		"vipsubscribe":"https://wx.jianyu360.cn/swordfish/SingleLogin?toHref=https://wx.jianyu360.cn/swordfish/SingleLogin?toHref=https://wx.jianyu360.cn/jy_mobile/common/order/create/svip?type=buy&title=%E8%B6%85%E7%BA%A7%E8%AE%A2%E9%98%85",
-		"dataPack":"https://wx.jianyu360.cn/swordfish/SingleLogin?toHref=https://wx.jianyu360.cn/swordfish/SingleLogin?toHref=/jy_mobile/common/order/create/datapack&title=%E6%95%B0%E6%8D%AE%E6%B5%81%E9%87%8F%E5%8C%85",
-		"doubleEleven":"https://www.jianyu360.cn/swordfish/SingleLogin?toHref=https://www.jianyu360.cn/swordfish/SingleLogin?toHref=https://www.jianyu360.cn/weixin/leads/doubleEleven&title=%E7%95%99%E8%B5%84%E4%BA%92%E5%8A%A8%E6%8A%BD%E5%A5%96",
-		"mayActive":"https://wx.jianyu360.cn/swordfish/SingleLogin?toHref=https://wx.jianyu360.cn/swordfish/SingleLogin?toHref=https://wx.jianyu360.cn/front/vipsubscribe/toSubVipSetPage?active=may&title=%E6%A0%87%E8%AE%AF%E8%AE%A2%E9%98%85&discored=81",
-		"introducePageB":"https://wx.jianyu360.cn/swordfish/SingleLogin?toHref=https://wx.jianyu360.cn/swordfish/SingleLogin?toHref=https://wx.jianyu360.cn/big/wx/page/landingPage&title=%E5%A4%A7%E4%BC%9A%E5%91%98%E4%BB%8B%E7%BB%8D%E9%A1%B5",
-		"pageBBuy":"https://wx.jianyu360.cn/swordfish/SingleLogin?toHref=https://wx.jianyu360.cn/swordfish/SingleLogin?toHref=https://wx.jianyu360.cn/jy_mobile/common/order/create/bigmember&title=%E5%A4%A7%E4%BC%9A%E5%91%98",
-		"wxSubscrbePage":"https://wx.jianyu360.cn/swordfish/SingleLogin?toHref=https://wx.jianyu360.cn/swordfish/SingleLogin?toHref=https://wx.jianyu360.cn/front/vipsubscribe/toSubVipSetPage"
-	},
 	"lottery":"https://host.huiju.cool/p/26256",
 	"mayActive":{
 		"wxEr":81,

+ 11 - 11
src/jfw/config/active.go

@@ -6,22 +6,22 @@ import (
 
 //系统配置
 type activeConfig struct {
-	Live_Preheat_Start int64             `json:"live_Preheat_Start"` //预热活动开始时间
-	Live_Preheat_End   int64             `json:"live_Preheat_End"`   //预热活动结束时间
-	Live_Active_Start  int64             `json:"live_Active_Start"`  //直播活动开始时间
-	Live_Active_End    int64             `json:"live_Active_End"`    //直播活动结束时间
-	Live_Ing_Start     int64             `json:"live_Ing_Start"`     //直播开始时间
-	Live_Ing_End       int64             `json:"live_Ing_End"`       //直播结束时间
-	Live_After_Date    int64             `json:"live_After_Date"`    //直播活动结束后 活动已结束提示时间段(暂定一个月) 一个月后 跳转到VIP介绍页
-	ActiveDiscount     float64           `json:"activeDiscount"`     //直播活动折扣
-	DoubleEleven       *doubleEleven     `json:"doubleEleven"`       //双十一
-	ShortUrl           map[string]string `json:"shortUrl"`           //短地址跳转
-	Lottery            string            `json:"lottery"`            //抽奖跳转连接
+	Live_Preheat_Start int64         `json:"live_Preheat_Start"` //预热活动开始时间
+	Live_Preheat_End   int64         `json:"live_Preheat_End"`   //预热活动结束时间
+	Live_Active_Start  int64         `json:"live_Active_Start"`  //直播活动开始时间
+	Live_Active_End    int64         `json:"live_Active_End"`    //直播活动结束时间
+	Live_Ing_Start     int64         `json:"live_Ing_Start"`     //直播开始时间
+	Live_Ing_End       int64         `json:"live_Ing_End"`       //直播结束时间
+	Live_After_Date    int64         `json:"live_After_Date"`    //直播活动结束后 活动已结束提示时间段(暂定一个月) 一个月后 跳转到VIP介绍页
+	ActiveDiscount     float64       `json:"activeDiscount"`     //直播活动折扣
+	DoubleEleven       *doubleEleven `json:"doubleEleven"`       //双十一
+	Lottery            string        `json:"lottery"`            //抽奖跳转连接
 	MayActive          struct {
 		WxEr      int64  `json:"wxEr"`
 		StartTime string `json:"startTime"`
 		EndTime   string `json:"endTime"`
 	} `json:"mayActive"` //五月运营统计二维码
+	//ShortUrl           map[string]string `json:"shortUrl"`           //短地址跳转
 }
 
 //双十一活动

+ 9 - 2
src/jfw/front/singleLogin.go

@@ -32,8 +32,15 @@ func init() {
 //短地址跳转
 func (this *SingleLogin) ShortUrl(key string) error {
 	var redirectUrl = "/swordfish/about"
-	if key != "" && config.ActiveConfig.ShortUrl[key] != "" {
-		redirectUrl = config.ActiveConfig.ShortUrl[key]
+	if key != "" { //}&& config.ActiveConfig.ShortUrl[key] != "" {
+		//redirectUrl = config.ActiveConfig.ShortUrl[key]
+		shortUrls := public.Mysql.SelectBySql(`SELECT * FROM short_url WHERE mold = 1 AND code = ?`, key)
+		if shortUrls != nil && len(*shortUrls) > 0 {
+			shortUrl := (*shortUrls)[0]
+			if qutil.ObjToString(shortUrl["url"]) != "" {
+				redirectUrl = qutil.ObjToString(shortUrl["url"])
+			}
+		}
 	}
 	return this.Redirect(redirectUrl)
 }