Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

Merge branch 'feat/0.7.0/user-manage' into test

LinkinStarb8d2d6e27923
diff --cc internal/service/search_parser/search_parser.go
index a34baecf,b3d7492e..e90ab1f8
--- a/internal/service/search_parser/search_parser.go
+++ b/internal/service/search_parser/search_parser.go
@@@ -189,12 -189,9 +189,12 @@@ func (sp *SearchParser) parseUserID(que
re := regexp.MustCompile(exprUserID)
res := re.FindStringSubmatch(q)
- if len(res) == 2 {
+ if strings.Index(q, exprMe) != -1 {
+ userID = currentUserID
+ q = strings.ReplaceAll(q, exprMe, "")
+ } else if len(res) == 2 {
name := res[1]
- user, has, err := sp.userCommon.GetUserBasicInfoByUserName(nil, name)
+ user, has, err := sp.userCommon.GetUserBasicInfoByUserName(context.TODO(), name)
if err == nil && has {
userID = user.ID
q = re.ReplaceAllString(q, "")