|
@@ -9,13 +9,13 @@ import (
|
|
|
"fmt"
|
|
|
"jy/src/jfw/modules/app/src/app/config"
|
|
|
"jy/src/jfw/modules/app/src/app/jyutil"
|
|
|
- "strings"
|
|
|
+ "net/url"
|
|
|
"time"
|
|
|
)
|
|
|
|
|
|
type Activity struct {
|
|
|
*xweb.Action
|
|
|
- mini xweb.Mapper `xweb:"/jyapp/mini/(.*)"` // /min/001#3 p583短地址
|
|
|
+ mini xweb.Mapper `xweb:"/jyapp/m/(.*)"` // /min/0013 p583短地址
|
|
|
checkSubscribe xweb.Mapper `xweb:"/jyapp/checkSubscribe"` // 是否关注 p583短地址
|
|
|
}
|
|
|
|
|
@@ -35,13 +35,12 @@ func (s *Activity) Mini(args string) {
|
|
|
s.ServeJson(api.NewResult(nil, errors.New("参数异常")))
|
|
|
return
|
|
|
}
|
|
|
- sidStrSplit := strings.Split(sidStr, "#")
|
|
|
- if len(sidStrSplit) != 2 {
|
|
|
+ if len(sidStr) < 2 {
|
|
|
s.ServeJson(api.NewResult(nil, errors.New("参数异常")))
|
|
|
}
|
|
|
- step := common.IntAll(sidStrSplit[1])
|
|
|
- id := common.IntAll(sidStrSplit[0])
|
|
|
- encryId := encrypt.SE.EncodeString(sidStrSplit[0])
|
|
|
+ step := common.IntAll(sidStr[len(sidStr)-1:])
|
|
|
+ id := common.IntAll(sidStr[:len(sidStr)-1])
|
|
|
+ encryId := encrypt.SE.EncodeString(sidStr[:len(sidStr)-1])
|
|
|
if step > len(config.Active.ActivateInfo.To) || id == 0 || common.IntAll(id) == 0 {
|
|
|
s.ServeJson(api.NewResult(nil, errors.New("参数异常")))
|
|
|
return
|
|
@@ -59,10 +58,10 @@ func (s *Activity) Mini(args string) {
|
|
|
s.T["env_version"] = config.Active.ActivateInfo.EnvVersion
|
|
|
if jyutil.IsSubscribe(userId) {
|
|
|
s.T["path"] = config.Active.ActivateInfo.To[stepIndex].Path.Sub
|
|
|
- s.T["query"] = fmt.Sprintf(config.Active.ActivateInfo.To[stepIndex].Query.Sub, encryId)
|
|
|
+ s.T["query"] = url.QueryEscape(fmt.Sprintf(config.Active.ActivateInfo.To[stepIndex].Query.Sub, encryId))
|
|
|
} else {
|
|
|
s.T["path"] = config.Active.ActivateInfo.To[stepIndex].Path.Unsub
|
|
|
- s.T["query"] = fmt.Sprintf(config.Active.ActivateInfo.To[stepIndex].Query.Unsub, encryId)
|
|
|
+ s.T["query"] = url.QueryEscape(fmt.Sprintf(config.Active.ActivateInfo.To[stepIndex].Query.Unsub, encryId))
|
|
|
}
|
|
|
s.Render(config.Active.ActivateInfo.To[stepIndex].Url, &s.T)
|
|
|
return
|