feat-IRONFANS-212-Robin #910
|
@ -2332,7 +2332,7 @@ func (s *Service) utilBuildInwardHyperLink(ctx *gin.Context, frontendRouteId int
|
|||
// 将跳转路径的占位符替换
|
||||
appRoute, err := regexpcli.GetRegexp(consts.AppHyperlinkRegexp).ReplaceFunc(
|
||||
frontendroute.GetAppRoutePath(), func(m regexp2.Match) string {
|
||||
return fmt.Sprint(argsMap["app"][m.Groups()[1].String()])
|
||||
return fmt.Sprint(argsMap["app"][strings.ToUpper(m.Groups()[2].String())])
|
||||
}, -1, -1)
|
||||
if err != nil {
|
||||
logger.Error("regexp2 ReplaceFunc fail, err: %v", err)
|
||||
|
@ -2341,7 +2341,7 @@ func (s *Service) utilBuildInwardHyperLink(ctx *gin.Context, frontendRouteId int
|
|||
|
||||
h5Route, err := regexpcli.GetRegexp(consts.H5HyperlinkRegexp).ReplaceFunc(
|
||||
frontendroute.GetH5RoutePath(), func(m regexp2.Match) string {
|
||||
return fmt.Sprintf("%v%v", m.String(), argsMap["h5"][m.Groups()[2].String()])
|
||||
return fmt.Sprint(argsMap["h5"][m.Groups()[1].String()])
|
||||
}, -1, -1)
|
||||
if err != nil {
|
||||
logger.Error("regexp2 ReplaceFunc fail, err: %v", err)
|
||||
|
|
|
@ -16,8 +16,8 @@ func Init() {
|
|||
defaultRegexpClient = new(Client)
|
||||
|
||||
defaultRegexpClient.regexpMap = make(map[string]*regexp2.Regexp)
|
||||
defaultRegexpClient.regexpMap[consts.AppHyperlinkRegexp] = regexp2.MustCompile(`\[(.*?)\]`, 0)
|
||||
defaultRegexpClient.regexpMap[consts.H5HyperlinkRegexp] = regexp2.MustCompile(`(\?|&)(.*?)=`, 0)
|
||||
defaultRegexpClient.regexpMap[consts.AppHyperlinkRegexp] = regexp2.MustCompile(`(.*?)=(.*?)&*`, 0)
|
||||
defaultRegexpClient.regexpMap[consts.H5HyperlinkRegexp] = regexp2.MustCompile(`\[(.*?)\]`, 0)
|
||||
}
|
||||
|
||||
func GetRegexp(str string) *regexp2.Regexp {
|
||||
|
|
Loading…
Reference in New Issue