fix(api): 修改 YMTUsersAPI 列表方法以忽略搜索关键词
- 在 list 方法中,始终返回所有用户数据,忽略查询参数 q。 - 将 keyword 变量设置为空字符串,以确保不进行过滤。
This commit is contained in:
parent
2236a6068b
commit
743e2bc4d2
|
|
@ -54,8 +54,10 @@ func (a *YMTUsersAPI) list(w http.ResponseWriter, r *http.Request) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 忽略 q 参数,始终返回所有数据(不做过滤)
|
||||||
// 获取搜索关键词(如果有)
|
// 获取搜索关键词(如果有)
|
||||||
keyword := r.URL.Query().Get("q")
|
// keyword := r.URL.Query().Get("q")
|
||||||
|
keyword := "" // 始终传空字符串,返回所有数据
|
||||||
|
|
||||||
// 创建带超时的 context
|
// 创建带超时的 context
|
||||||
ctx, cancel := context.WithTimeout(r.Context(), 10*time.Second)
|
ctx, cancel := context.WithTimeout(r.Context(), 10*time.Second)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue