feat(frontend): WebSocket 客户端 + Contact Store + API
- services/websocket.js: 单例 WS 连接管理(心跳/重连/事件分发) - store/websocket.js: Pinia Store 管理连接状态 - store/contact.js: 联系人 Store(好友/申请/分组/黑名单/在线状态) - api/contact.js: 联系人 REST API 封装(17 个接口) - api/user.js: 用户搜索 API Made-with: Cursor
This commit is contained in:
16
frontend/src/api/user.js
Normal file
16
frontend/src/api/user.js
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* 用户搜索 API
|
||||
*
|
||||
* 对应后端路由:/api/v1/users/*
|
||||
*/
|
||||
|
||||
import { get } from '@/utils/request'
|
||||
|
||||
/** 搜索用户(按用户名/昵称模糊匹配) */
|
||||
const searchUsers = (keyword, page = 1, pageSize = 20) => {
|
||||
return get('/api/v1/users/search', { keyword, page, page_size: pageSize })
|
||||
}
|
||||
|
||||
export default {
|
||||
searchUsers
|
||||
}
|
||||
Reference in New Issue
Block a user