docs(sdk): 添加 Android SDK 文档和 API 设计规范

- 新增 Android SDK 使用文档,包含模块结构、集成方式和快速开始指南
- 添加 SDK API 重设计规范,统一初始化和登录接口设计
- 补充安全设计规范,完善 UserSig 鉴权和敏感数据处理方案
- 创建平台 REST API 规范,定义服务端到服务端的调用接口
- 添加离线推送架构设计,集成各大厂商推送服务与 IM 联动方案
这个提交包含在:
XuqmGroup 2026-04-29 15:46:39 +08:00
父节点 92ba64ded4
当前提交 2c0ac124d7
共有 5 个文件被更改,包括 6 次插入6 次删除

查看文件

@ -39,8 +39,6 @@ import { init } from '@xuqm/vue3-sdk'
init({
appKey: 'ak_your_app_key',
appSecret: 'as_your_app_secret',
apiBaseUrl: 'https://api.xuqm.com',
imBaseUrl: 'wss://im.xuqm.com',
debug: import.meta.env.DEV,
})
```

2
src/core/endpoints.ts 普通文件
查看文件

@ -0,0 +1,2 @@
export const DEFAULT_API_BASE_URL = 'https://dev.xuqinmin.com'
export const DEFAULT_IM_WS_URL = 'wss://dev.xuqinmin.com/ws/im'

查看文件

@ -1,5 +1,6 @@
import type { SDKConfig } from '../types'
import { configureHttp } from './http'
import { DEFAULT_API_BASE_URL } from './endpoints'
let _config: SDKConfig | null = null
let _token: string | null = null
@ -7,7 +8,7 @@ let _userId: string | null = null
export function init(config: SDKConfig) {
_config = config
configureHttp(config.apiBaseUrl, () => _token)
configureHttp(DEFAULT_API_BASE_URL, () => _token)
if (config.debug) console.log('[XuqmSDK] initialized', config.appKey)
}

查看文件

@ -1,5 +1,6 @@
import type { ImMessage, SendMessageParams, ImEventMap } from '../types'
import { getConfig, getToken, getUserId } from '../core/sdk'
import { DEFAULT_IM_WS_URL } from '../core/endpoints'
type EventListener<K extends keyof ImEventMap> = ImEventMap[K]
@ -35,7 +36,7 @@ export class ImClient {
if (this.destroyed) return
const config = getConfig()
const token = getToken()
const url = `${config.imBaseUrl}/ws/im?token=${token ?? ''}`
const url = `${DEFAULT_IM_WS_URL}?token=${token ?? ''}`
this.ws = new WebSocket(url)

查看文件

@ -1,8 +1,6 @@
export interface SDKConfig {
appKey: string
appSecret: string
apiBaseUrl: string
imBaseUrl: string
debug?: boolean
}