chore: sync local changes

这个提交包含在:
XuqmGroup 2026-05-07 19:39:40 +08:00
父节点 6c11380a36
当前提交 078297fc06
共有 3 个文件被更改,包括 59 次插入61 次删除

查看文件

@ -38,7 +38,7 @@ export type MsgStatus = 'SENDING' | 'SENT' | 'DELIVERED' | 'READ' | 'FAILED' | '
export interface ImMessage { export interface ImMessage {
id: string id: string
appId: string appKey: string
fromUserId: string fromUserId: string
fromId: string fromId: string
toId: string toId: string
@ -86,7 +86,7 @@ export interface PageResult<T> {
export interface UserProfile { export interface UserProfile {
id?: string id?: string
appId?: string appKey?: string
userId: string userId: string
nickname?: string | null nickname?: string | null
avatar?: string | null avatar?: string | null
@ -97,7 +97,7 @@ export interface UserProfile {
export interface ImGroup { export interface ImGroup {
id: string id: string
appId?: string appKey?: string
name: string name: string
groupType?: string groupType?: string
creatorId: string creatorId: string
@ -109,7 +109,7 @@ export interface ImGroup {
export interface FriendRequest { export interface FriendRequest {
id: string id: string
appId?: string appKey?: string
fromUserId: string fromUserId: string
toUserId: string toUserId: string
remark?: string | null remark?: string | null
@ -120,7 +120,7 @@ export interface FriendRequest {
export interface GroupJoinRequest { export interface GroupJoinRequest {
id: string id: string
appId?: string appKey?: string
groupId: string groupId: string
requesterId: string requesterId: string
remark?: string | null remark?: string | null

查看文件

@ -43,11 +43,11 @@ class WebSocketEnvelope {
} }
class AppBody { class AppBody {
appId: string = '' appKey: string = ''
} }
class HistoryQueryParams { class HistoryQueryParams {
appId: string = '' appKey: string = ''
page: number = 0 page: number = 0
size: number = 0 size: number = 0
msgType: MsgType = 'TEXT' msgType: MsgType = 'TEXT'
@ -57,23 +57,23 @@ class HistoryQueryParams {
} }
class ConversationActionBody { class ConversationActionBody {
appId: string = '' appKey: string = ''
chatType: ChatType = 'SINGLE' chatType: ChatType = 'SINGLE'
} }
class FriendRequestQueryBody { class FriendRequestQueryBody {
appId: string = '' appKey: string = ''
direction: 'incoming' | 'outgoing' = 'incoming' direction: 'incoming' | 'outgoing' = 'incoming'
} }
class FriendRequestBody { class FriendRequestBody {
appId: string = '' appKey: string = ''
toUserId: string = '' toUserId: string = ''
remark: string = '' remark: string = ''
} }
class GroupJoinRequestBody { class GroupJoinRequestBody {
appId: string = '' appKey: string = ''
remark: string = '' remark: string = ''
} }
@ -82,26 +82,26 @@ class EditMessageBody {
} }
class UpdateProfileBody { class UpdateProfileBody {
appId: string = '' appKey: string = ''
nickname: string = '' nickname: string = ''
avatar: string = '' avatar: string = ''
gender: string = '' gender: string = ''
} }
class DraftBody { class DraftBody {
appId: string = '' appKey: string = ''
chatType: ChatType = 'SINGLE' chatType: ChatType = 'SINGLE'
draft: string = '' draft: string = ''
} }
class PinBody { class PinBody {
appId: string = '' appKey: string = ''
chatType: ChatType = 'SINGLE' chatType: ChatType = 'SINGLE'
pinned: boolean = false pinned: boolean = false
} }
class MuteBody { class MuteBody {
appId: string = '' appKey: string = ''
chatType: ChatType = 'SINGLE' chatType: ChatType = 'SINGLE'
muted: boolean = false muted: boolean = false
} }
@ -290,7 +290,7 @@ export class ImClient {
async setDraft(targetId: string, chatType: ChatType, draft: string): Promise<void> { async setDraft(targetId: string, chatType: ChatType, draft: string): Promise<void> {
const params = new DraftBody() const params = new DraftBody()
params.appId = SDKContext.getConfig().appKey params.appKey = SDKContext.getConfig().appKey
params.chatType = chatType params.chatType = chatType
params.draft = draft params.draft = draft
await HttpClient.put<void>('/api/im/conversations/' + encodeURIComponent(targetId) + '/draft', params) await HttpClient.put<void>('/api/im/conversations/' + encodeURIComponent(targetId) + '/draft', params)
@ -298,7 +298,7 @@ export class ImClient {
async setConversationPinned(targetId: string, chatType: ChatType, pinned: boolean): Promise<void> { async setConversationPinned(targetId: string, chatType: ChatType, pinned: boolean): Promise<void> {
const params = new PinBody() const params = new PinBody()
params.appId = SDKContext.getConfig().appKey params.appKey = SDKContext.getConfig().appKey
params.chatType = chatType params.chatType = chatType
params.pinned = pinned params.pinned = pinned
await HttpClient.put<void>('/api/im/conversations/' + encodeURIComponent(targetId) + '/pinned', params) await HttpClient.put<void>('/api/im/conversations/' + encodeURIComponent(targetId) + '/pinned', params)
@ -306,7 +306,7 @@ export class ImClient {
async setConversationMuted(targetId: string, chatType: ChatType, muted: boolean): Promise<void> { async setConversationMuted(targetId: string, chatType: ChatType, muted: boolean): Promise<void> {
const params = new MuteBody() const params = new MuteBody()
params.appId = SDKContext.getConfig().appKey params.appKey = SDKContext.getConfig().appKey
params.chatType = chatType params.chatType = chatType
params.muted = muted params.muted = muted
await HttpClient.put<void>('/api/im/conversations/' + encodeURIComponent(targetId) + '/muted', params) await HttpClient.put<void>('/api/im/conversations/' + encodeURIComponent(targetId) + '/muted', params)
@ -389,7 +389,7 @@ export class ImClient {
async sendFriendRequest(toUserId: string, remark: string | null = null): Promise<FriendRequest> { async sendFriendRequest(toUserId: string, remark: string | null = null): Promise<FriendRequest> {
const params = new FriendRequestBody() const params = new FriendRequestBody()
params.appId = SDKContext.getConfig().appKey params.appKey = SDKContext.getConfig().appKey
params.toUserId = toUserId params.toUserId = toUserId
if (remark !== null && remark !== '') { if (remark !== null && remark !== '') {
params.remark = remark params.remark = remark
@ -411,7 +411,7 @@ export class ImClient {
async sendGroupJoinRequest(groupId: string, remark: string | null = null): Promise<GroupJoinRequest> { async sendGroupJoinRequest(groupId: string, remark: string | null = null): Promise<GroupJoinRequest> {
const params = new GroupJoinRequestBody() const params = new GroupJoinRequestBody()
params.appId = SDKContext.getConfig().appKey params.appKey = SDKContext.getConfig().appKey
if (remark !== null && remark !== '') { if (remark !== null && remark !== '') {
params.remark = remark params.remark = remark
} }
@ -447,7 +447,7 @@ export class ImClient {
gender: string | null = null, gender: string | null = null,
): Promise<UserProfile> { ): Promise<UserProfile> {
const params = new UpdateProfileBody() const params = new UpdateProfileBody()
params.appId = SDKContext.getConfig().appKey params.appKey = SDKContext.getConfig().appKey
if (nickname !== null) { if (nickname !== null) {
params.nickname = nickname params.nickname = nickname
} }
@ -463,12 +463,12 @@ export class ImClient {
/* ---------- 会话扩展 ---------- */ /* ---------- 会话扩展 ---------- */
async setConversationHidden(targetId: string, hidden: boolean): Promise<void> { async setConversationHidden(targetId: string, hidden: boolean): Promise<void> {
const params = new AppBody() const params = new AppBody()
params.appId = SDKContext.getConfig().appKey params.appKey = SDKContext.getConfig().appKey
await HttpClient.put<void>('/api/im/conversations/' + encodeURIComponent(targetId) + '/hidden', params) await HttpClient.put<void>('/api/im/conversations/' + encodeURIComponent(targetId) + '/hidden', params)
} }
async setConversationGroup(targetId: string, groupName: string): Promise<void> { async setConversationGroup(targetId: string, groupName: string): Promise<void> {
const params = { appId: SDKContext.getConfig().appKey, groupName } const params = { appKey: SDKContext.getConfig().appKey, groupName }
await HttpClient.put<void>('/api/im/conversations/' + encodeURIComponent(targetId) + '/group', params) await HttpClient.put<void>('/api/im/conversations/' + encodeURIComponent(targetId) + '/group', params)
} }
@ -482,7 +482,7 @@ export class ImClient {
/* ---------- 好友扩展 ---------- */ /* ---------- 好友扩展 ---------- */
async addFriend(friendId: string): Promise<void> { async addFriend(friendId: string): Promise<void> {
const params = { appId: SDKContext.getConfig().appKey, friendId } const params = { appKey: SDKContext.getConfig().appKey, friendId }
await HttpClient.post<void>('/api/im/friends', params) await HttpClient.post<void>('/api/im/friends', params)
} }
@ -495,7 +495,7 @@ export class ImClient {
} }
async setFriendGroup(friendId: string, groupName: string): Promise<void> { async setFriendGroup(friendId: string, groupName: string): Promise<void> {
const params = { appId: SDKContext.getConfig().appKey, groupName } const params = { appKey: SDKContext.getConfig().appKey, groupName }
await HttpClient.put<void>('/api/im/friends/' + encodeURIComponent(friendId) + '/group', params) await HttpClient.put<void>('/api/im/friends/' + encodeURIComponent(friendId) + '/group', params)
} }
@ -508,7 +508,7 @@ export class ImClient {
} }
async checkFriends(friendIds: string[]): Promise<Record<string, boolean>> { async checkFriends(friendIds: string[]): Promise<Record<string, boolean>> {
const params = { appId: SDKContext.getConfig().appKey, friendIds } const params = { appKey: SDKContext.getConfig().appKey, friendIds }
return HttpClient.post<Record<string, boolean>>('/api/im/friends/check', params) return HttpClient.post<Record<string, boolean>>('/api/im/friends/check', params)
} }
@ -518,7 +518,7 @@ export class ImClient {
} }
async addToBlacklist(userId: string): Promise<void> { async addToBlacklist(userId: string): Promise<void> {
const params = { appId: SDKContext.getConfig().appKey, userId } const params = { appKey: SDKContext.getConfig().appKey, userId }
await HttpClient.post<void>('/api/im/blacklist', params) await HttpClient.post<void>('/api/im/blacklist', params)
} }
@ -535,19 +535,19 @@ export class ImClient {
/* ---------- 群组扩展 ---------- */ /* ---------- 群组扩展 ---------- */
async createGroup(name: string, memberIds: string[], groupType: string = 'WORK'): Promise<ImGroup> { async createGroup(name: string, memberIds: string[], groupType: string = 'WORK'): Promise<ImGroup> {
const params = { appId: SDKContext.getConfig().appKey, name, memberIds, groupType } const params = { appKey: SDKContext.getConfig().appKey, name, memberIds, groupType }
return HttpClient.post<ImGroup>('/api/im/groups', params) return HttpClient.post<ImGroup>('/api/im/groups', params)
} }
async updateGroupInfo(groupId: string, name?: string, announcement?: string): Promise<ImGroup> { async updateGroupInfo(groupId: string, name?: string, announcement?: string): Promise<ImGroup> {
const params: Record<string, string> = { appId: SDKContext.getConfig().appKey } const params: Record<string, string> = { appKey: SDKContext.getConfig().appKey }
if (name !== undefined) params.name = name if (name !== undefined) params.name = name
if (announcement !== undefined) params.announcement = announcement if (announcement !== undefined) params.announcement = announcement
return HttpClient.put<ImGroup>('/api/im/groups/' + encodeURIComponent(groupId), params) return HttpClient.put<ImGroup>('/api/im/groups/' + encodeURIComponent(groupId), params)
} }
async addGroupMember(groupId: string, userId: string): Promise<void> { async addGroupMember(groupId: string, userId: string): Promise<void> {
const params = { appId: SDKContext.getConfig().appKey, userId } const params = { appKey: SDKContext.getConfig().appKey, userId }
await HttpClient.post<void>('/api/im/groups/' + encodeURIComponent(groupId) + '/members', params) await HttpClient.post<void>('/api/im/groups/' + encodeURIComponent(groupId) + '/members', params)
} }
@ -560,27 +560,27 @@ export class ImClient {
} }
async setGroupRole(groupId: string, userId: string, role: 'ADMIN' | 'MEMBER'): Promise<void> { async setGroupRole(groupId: string, userId: string, role: 'ADMIN' | 'MEMBER'): Promise<void> {
const params = { appId: SDKContext.getConfig().appKey, userId, role } const params = { appKey: SDKContext.getConfig().appKey, userId, role }
await HttpClient.post<void>('/api/im/groups/' + encodeURIComponent(groupId) + '/roles', params) await HttpClient.post<void>('/api/im/groups/' + encodeURIComponent(groupId) + '/roles', params)
} }
async muteGroupMember(groupId: string, userId: string, muted: boolean): Promise<void> { async muteGroupMember(groupId: string, userId: string, muted: boolean): Promise<void> {
const params = { appId: SDKContext.getConfig().appKey, userId, muted } const params = { appKey: SDKContext.getConfig().appKey, userId, muted }
await HttpClient.post<void>('/api/im/groups/' + encodeURIComponent(groupId) + '/mute', params) await HttpClient.post<void>('/api/im/groups/' + encodeURIComponent(groupId) + '/mute', params)
} }
async transferGroupOwner(groupId: string, newOwnerId: string): Promise<ImGroup> { async transferGroupOwner(groupId: string, newOwnerId: string): Promise<ImGroup> {
const params = { appId: SDKContext.getConfig().appKey, newOwnerId } const params = { appKey: SDKContext.getConfig().appKey, newOwnerId }
return HttpClient.post<ImGroup>('/api/im/groups/' + encodeURIComponent(groupId) + '/owner', params) return HttpClient.post<ImGroup>('/api/im/groups/' + encodeURIComponent(groupId) + '/owner', params)
} }
async updateGroupAttributes(groupId: string, attributes: Record<string, string | number | boolean | null>): Promise<void> { async updateGroupAttributes(groupId: string, attributes: Record<string, string | number | boolean | null>): Promise<void> {
const params = { appId: SDKContext.getConfig().appKey, attributes } const params = { appKey: SDKContext.getConfig().appKey, attributes }
await HttpClient.put<void>('/api/im/groups/' + encodeURIComponent(groupId) + '/attributes', params) await HttpClient.put<void>('/api/im/groups/' + encodeURIComponent(groupId) + '/attributes', params)
} }
async removeGroupAttributes(groupId: string, keys: string[]): Promise<void> { async removeGroupAttributes(groupId: string, keys: string[]): Promise<void> {
const params = { appId: SDKContext.getConfig().appKey, keys } const params = { appKey: SDKContext.getConfig().appKey, keys }
await HttpClient.post<void>('/api/im/groups/' + encodeURIComponent(groupId) + '/attributes/delete', params) await HttpClient.post<void>('/api/im/groups/' + encodeURIComponent(groupId) + '/attributes/delete', params)
} }
@ -590,47 +590,47 @@ export class ImClient {
/* ---------- 批量操作 ---------- */ /* ---------- 批量操作 ---------- */
async batchAddFriends(friendIds: string[]): Promise<void> { async batchAddFriends(friendIds: string[]): Promise<void> {
const params = { appId: SDKContext.getConfig().appKey, friendIds } const params = { appKey: SDKContext.getConfig().appKey, friendIds }
await HttpClient.post<void>('/api/im/friends/batch', params) await HttpClient.post<void>('/api/im/friends/batch', params)
} }
async batchRemoveFriends(friendIds: string[]): Promise<void> { async batchRemoveFriends(friendIds: string[]): Promise<void> {
const params = { appId: SDKContext.getConfig().appKey, friendIds } const params = { appKey: SDKContext.getConfig().appKey, friendIds }
await HttpClient.post<void>('/api/im/friends/batch/remove', params) await HttpClient.post<void>('/api/im/friends/batch/remove', params)
} }
async batchAcceptFriendRequests(requestIds: string[]): Promise<void> { async batchAcceptFriendRequests(requestIds: string[]): Promise<void> {
const params = { appId: SDKContext.getConfig().appKey, requestIds } const params = { appKey: SDKContext.getConfig().appKey, requestIds }
await HttpClient.post<void>('/api/im/friend-requests/batch/accept', params) await HttpClient.post<void>('/api/im/friend-requests/batch/accept', params)
} }
async batchRejectFriendRequests(requestIds: string[]): Promise<void> { async batchRejectFriendRequests(requestIds: string[]): Promise<void> {
const params = { appId: SDKContext.getConfig().appKey, requestIds } const params = { appKey: SDKContext.getConfig().appKey, requestIds }
await HttpClient.post<void>('/api/im/friend-requests/batch/reject', params) await HttpClient.post<void>('/api/im/friend-requests/batch/reject', params)
} }
async batchAddMembers(groupId: string, userIds: string[]): Promise<void> { async batchAddMembers(groupId: string, userIds: string[]): Promise<void> {
const params = { appId: SDKContext.getConfig().appKey, userIds } const params = { appKey: SDKContext.getConfig().appKey, userIds }
await HttpClient.post<void>('/api/im/groups/' + encodeURIComponent(groupId) + '/members/batch', params) await HttpClient.post<void>('/api/im/groups/' + encodeURIComponent(groupId) + '/members/batch', params)
} }
async batchRemoveMembers(groupId: string, userIds: string[]): Promise<void> { async batchRemoveMembers(groupId: string, userIds: string[]): Promise<void> {
const params = { appId: SDKContext.getConfig().appKey, userIds } const params = { appKey: SDKContext.getConfig().appKey, userIds }
await HttpClient.post<void>('/api/im/groups/' + encodeURIComponent(groupId) + '/members/batch/remove', params) await HttpClient.post<void>('/api/im/groups/' + encodeURIComponent(groupId) + '/members/batch/remove', params)
} }
async batchAcceptJoinRequests(groupId: string, requestIds: string[]): Promise<void> { async batchAcceptJoinRequests(groupId: string, requestIds: string[]): Promise<void> {
const params = { appId: SDKContext.getConfig().appKey, requestIds } const params = { appKey: SDKContext.getConfig().appKey, requestIds }
await HttpClient.post<void>('/api/im/groups/' + encodeURIComponent(groupId) + '/join-requests/batch/accept', params) await HttpClient.post<void>('/api/im/groups/' + encodeURIComponent(groupId) + '/join-requests/batch/accept', params)
} }
async batchRejectJoinRequests(groupId: string, requestIds: string[]): Promise<void> { async batchRejectJoinRequests(groupId: string, requestIds: string[]): Promise<void> {
const params = { appId: SDKContext.getConfig().appKey, requestIds } const params = { appKey: SDKContext.getConfig().appKey, requestIds }
await HttpClient.post<void>('/api/im/groups/' + encodeURIComponent(groupId) + '/join-requests/batch/reject', params) await HttpClient.post<void>('/api/im/groups/' + encodeURIComponent(groupId) + '/join-requests/batch/reject', params)
} }
async modifyMemberInfo(groupId: string, userId: string, nickname?: string, role?: string): Promise<void> { async modifyMemberInfo(groupId: string, userId: string, nickname?: string, role?: string): Promise<void> {
const params: Record<string, string> = { appId: SDKContext.getConfig().appKey } const params: Record<string, string> = { appKey: SDKContext.getConfig().appKey }
if (nickname !== undefined) params.nickname = nickname if (nickname !== undefined) params.nickname = nickname
if (role !== undefined) params.role = role if (role !== undefined) params.role = role
await HttpClient.put<void>('/api/im/groups/' + encodeURIComponent(groupId) + '/members/' + encodeURIComponent(userId) + '/info', params) await HttpClient.put<void>('/api/im/groups/' + encodeURIComponent(groupId) + '/members/' + encodeURIComponent(userId) + '/info', params)
@ -638,28 +638,28 @@ export class ImClient {
private buildAppBody(): AppBody { private buildAppBody(): AppBody {
const body = new AppBody() const body = new AppBody()
body.appId = SDKContext.getConfig().appKey body.appKey = SDKContext.getConfig().appKey
return body return body
} }
private buildAppQuery(): string { private buildAppQuery(): string {
return 'appId=' + encodeURIComponent(SDKContext.getConfig().appKey) return 'appKey=' + encodeURIComponent(SDKContext.getConfig().appKey)
} }
private buildConversationActionQuery(chatType: ChatType): string { private buildConversationActionQuery(chatType: ChatType): string {
return 'appId=' + encodeURIComponent(SDKContext.getConfig().appKey) + '&chatType=' + encodeURIComponent(chatType) return 'appKey=' + encodeURIComponent(SDKContext.getConfig().appKey) + '&chatType=' + encodeURIComponent(chatType)
} }
private buildConversationQuery(size: number): string { private buildConversationQuery(size: number): string {
return 'appId=' + encodeURIComponent(SDKContext.getConfig().appKey) + '&page=0&size=' + encodeURIComponent(size) return 'appKey=' + encodeURIComponent(SDKContext.getConfig().appKey) + '&page=0&size=' + encodeURIComponent(size)
} }
private buildFriendRequestQuery(direction: 'incoming' | 'outgoing'): string { private buildFriendRequestQuery(direction: 'incoming' | 'outgoing'): string {
return 'appId=' + encodeURIComponent(SDKContext.getConfig().appKey) + '&direction=' + encodeURIComponent(direction) return 'appKey=' + encodeURIComponent(SDKContext.getConfig().appKey) + '&direction=' + encodeURIComponent(direction)
} }
private buildSearchQuery(keyword: string, size: number): string { private buildSearchQuery(keyword: string, size: number): string {
return 'appId=' + encodeURIComponent(SDKContext.getConfig().appKey) + return 'appKey=' + encodeURIComponent(SDKContext.getConfig().appKey) +
'&keyword=' + encodeURIComponent(keyword) + '&keyword=' + encodeURIComponent(keyword) +
'&size=' + encodeURIComponent(size) '&size=' + encodeURIComponent(size)
} }
@ -672,7 +672,7 @@ export class ImClient {
size: number, size: number,
): string { ): string {
const parts: string[] = [] const parts: string[] = []
parts.push('appId=' + encodeURIComponent(SDKContext.getConfig().appKey)) parts.push('appKey=' + encodeURIComponent(SDKContext.getConfig().appKey))
if (keyword !== '') { if (keyword !== '') {
parts.push('keyword=' + encodeURIComponent(keyword)) parts.push('keyword=' + encodeURIComponent(keyword))
} }
@ -689,7 +689,7 @@ export class ImClient {
private buildHistoryQuery(page: number, size: number, query: HistoryQuery): string { private buildHistoryQuery(page: number, size: number, query: HistoryQuery): string {
const parts: string[] = [] const parts: string[] = []
parts.push('appId=' + encodeURIComponent(SDKContext.getConfig().appKey)) parts.push('appKey=' + encodeURIComponent(SDKContext.getConfig().appKey))
parts.push('page=' + encodeURIComponent(page)) parts.push('page=' + encodeURIComponent(page))
parts.push('size=' + encodeURIComponent(size)) parts.push('size=' + encodeURIComponent(size))
if (query.msgType !== undefined) { if (query.msgType !== undefined) {
@ -806,11 +806,10 @@ export class ImClient {
private buildOutgoingMessage(params: SendMessageParams): ImMessage { private buildOutgoingMessage(params: SendMessageParams): ImMessage {
const messageId = params.messageId ?? this.generateMessageId() const messageId = params.messageId ?? this.generateMessageId()
const userId = SDKContext.getUserId() ?? '' const userId = SDKContext.getUserId() ?? ''
const appId = SDKContext.getConfig().appKey const appKey = SDKContext.getConfig().appKey
const message: ImMessage = { const message: ImMessage = {
id: messageId, id: messageId,
appId, appKey, fromUserId: userId,
fromUserId: userId,
fromId: userId, fromId: userId,
toId: params.toId, toId: params.toId,
chatType: params.chatType, chatType: params.chatType,
@ -828,8 +827,7 @@ export class ImClient {
private markFailed(message: ImMessage): ImMessage { private markFailed(message: ImMessage): ImMessage {
const failed: ImMessage = { const failed: ImMessage = {
id: message.id, id: message.id,
appId: message.appId, appKey: message.appKey, fromUserId: message.fromUserId,
fromUserId: message.fromUserId,
fromId: message.fromId, fromId: message.fromId,
toId: message.toId, toId: message.toId,
chatType: message.chatType, chatType: message.chatType,
@ -847,7 +845,7 @@ export class ImClient {
private normalizeMessage(message: ImMessage): ImMessage { private normalizeMessage(message: ImMessage): ImMessage {
const normalized: ImMessage = { const normalized: ImMessage = {
id: message.id, id: message.id,
appId: message.appId || SDKContext.getConfig().appKey, appKey: message.appKey || SDKContext.getConfig().appKey,
fromUserId: message.fromUserId, fromUserId: message.fromUserId,
fromId: message.fromId || message.fromUserId, fromId: message.fromId || message.fromUserId,
toId: message.toId, toId: message.toId,

查看文件

@ -72,7 +72,7 @@ export class PushSDK {
return return
} }
const query = PushSDK.queryString([ const query = PushSDK.queryString([
new QueryItem('appId', config.appKey), new QueryItem('appKey', config.appKey),
new QueryItem('userId', userId), new QueryItem('userId', userId),
new QueryItem('vendor', HARMONY_PUSH_VENDOR), new QueryItem('vendor', HARMONY_PUSH_VENDOR),
new QueryItem('token', token), new QueryItem('token', token),
@ -96,7 +96,7 @@ export class PushSDK {
static async unregisterToken(imUserId: string): Promise<void> { static async unregisterToken(imUserId: string): Promise<void> {
const config = SDKContext.getConfig() const config = SDKContext.getConfig()
const query = PushSDK.queryString([ const query = PushSDK.queryString([
new QueryItem('appId', config.appKey), new QueryItem('appKey', config.appKey),
new QueryItem('userId', imUserId), new QueryItem('userId', imUserId),
new QueryItem('vendor', HARMONY_PUSH_VENDOR), new QueryItem('vendor', HARMONY_PUSH_VENDOR),
new QueryItem('platform', HARMONY_PLATFORM), new QueryItem('platform', HARMONY_PLATFORM),
@ -111,7 +111,7 @@ export class PushSDK {
} }
const config = SDKContext.getConfig() const config = SDKContext.getConfig()
const query = PushSDK.queryString([ const query = PushSDK.queryString([
new QueryItem('appId', config.appKey), new QueryItem('appKey', config.appKey),
new QueryItem('platform', HARMONY_PLATFORM), new QueryItem('platform', HARMONY_PLATFORM),
]) ])
try { try {