|
@@ -40,7 +40,7 @@ func (s *Activity) Mini(args string) {
|
|
}
|
|
}
|
|
step := common.IntAll(sidStr[len(sidStr)-1:])
|
|
step := common.IntAll(sidStr[len(sidStr)-1:])
|
|
id := common.IntAll(sidStr[:len(sidStr)-1])
|
|
id := common.IntAll(sidStr[:len(sidStr)-1])
|
|
- encryId := encrypt.SE.EncodeString(sidStr[:len(sidStr)-1])
|
|
|
|
|
|
+ encryId := url.QueryEscape(encrypt.SE.EncodeString(sidStr[:len(sidStr)-1]))
|
|
if step > len(config.Active.ActivateInfo.To) || id == 0 || common.IntAll(id) == 0 {
|
|
if step > len(config.Active.ActivateInfo.To) || id == 0 || common.IntAll(id) == 0 {
|
|
s.ServeJson(api.NewResult(nil, errors.New("参数异常")))
|
|
s.ServeJson(api.NewResult(nil, errors.New("参数异常")))
|
|
return
|
|
return
|
|
@@ -52,26 +52,27 @@ func (s *Activity) Mini(args string) {
|
|
}
|
|
}
|
|
// 获取用户id
|
|
// 获取用户id
|
|
userId, positionID := jyutil.GetActivateUser(id)
|
|
userId, positionID := jyutil.GetActivateUser(id)
|
|
- if len(config.Active.ActivateInfo.To[stepIndex].Path.Sub) > 0 { // 有配置跳转地址的 走这块
|
|
|
|
- // 判断用户关注未关注
|
|
|
|
- s.T["appid"] = config.Active.ActivateInfo.AppID
|
|
|
|
- s.T["env_version"] = config.Active.ActivateInfo.EnvVersion
|
|
|
|
|
|
+ // 判断用户关注未关注
|
|
|
|
+ s.T["appid"] = config.Active.ActivateInfo.AppID
|
|
|
|
+ s.T["env_version"] = config.Active.ActivateInfo.EnvVersion
|
|
|
|
+ if config.Active.ActivateInfo.To[stepIndex].Path.Default == "" {
|
|
if jyutil.IsSubscribe(userId) {
|
|
if jyutil.IsSubscribe(userId) {
|
|
s.T["path"] = config.Active.ActivateInfo.To[stepIndex].Path.Sub
|
|
s.T["path"] = config.Active.ActivateInfo.To[stepIndex].Path.Sub
|
|
- s.T["query"] = url.QueryEscape(fmt.Sprintf(config.Active.ActivateInfo.To[stepIndex].Query.Sub, encryId))
|
|
|
|
|
|
+ s.T["query"] = fmt.Sprintf(config.Active.ActivateInfo.To[stepIndex].Query.Sub, encryId)
|
|
} else {
|
|
} else {
|
|
s.T["path"] = config.Active.ActivateInfo.To[stepIndex].Path.Unsub
|
|
s.T["path"] = config.Active.ActivateInfo.To[stepIndex].Path.Unsub
|
|
- s.T["query"] = url.QueryEscape(fmt.Sprintf(config.Active.ActivateInfo.To[stepIndex].Query.Unsub, encryId))
|
|
|
|
|
|
+ s.T["query"] = fmt.Sprintf(config.Active.ActivateInfo.To[stepIndex].Query.Unsub, encryId)
|
|
}
|
|
}
|
|
- s.Render(config.Active.ActivateInfo.To[stepIndex].Url, &s.T)
|
|
|
|
- return
|
|
|
|
} else {
|
|
} else {
|
|
if isFirst {
|
|
if isFirst {
|
|
// 没有点过则送7天会员
|
|
// 没有点过则送7天会员
|
|
jyutil.GiveVip(userId, positionID, s.Request.UserAgent())
|
|
jyutil.GiveVip(userId, positionID, s.Request.UserAgent())
|
|
}
|
|
}
|
|
- s.Redirect(config.Active.ActivateInfo.To[stepIndex].Url) // 活动的重定向到
|
|
|
|
|
|
+ s.T["path"] = config.Active.ActivateInfo.To[stepIndex].Path.Default
|
|
|
|
+ s.T["query"] = config.Active.ActivateInfo.To[stepIndex].Query.Default
|
|
}
|
|
}
|
|
|
|
+ s.Render(config.Active.ActivateInfo.Url, &s.T)
|
|
|
|
+ return
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|