This commit is contained in:
2023-12-07 14:23:26 +08:00
parent 228943fc02
commit 0760d28d36
13 changed files with 213 additions and 49 deletions

View File

@@ -1,3 +1,6 @@
依赖安装
yarn install
核心SDK使用Typescript开发, 使用js-conditional-compile-loader插件条件编译出微信小程序端, Web网页端使用的js sdk

View File

@@ -4,6 +4,7 @@
"description": "",
"main": "src/lim.ts",
"scripts": {
"preview": "yarn install",
"build:weblib": "cross-env NODE_ENV=production platform=web webpack --mode=production --config ./build/webpack.lib.config.js",
"build:unilib": "cross-env NODE_ENV=production platform=uniapp webpack --mode=production --config ./build/webpack.lib.config.js",
"build:wxlib": "cross-env NODE_ENV=production platform=wx webpack --mode=production --config ./build/webpack.lib.config.js",
@@ -59,4 +60,4 @@
"webpack-dev-server": "^3.8.0",
"webpack-merge": "^4.2.1"
}
}
}

View File

@@ -325,24 +325,8 @@ export class ImClient {
}
public getUserConversationList(lastSequence:Long): Promise<any> {
return new Promise((resolve, _) => {
let api = new HttpApi(this.httpUrl);
let resp = api.call("/conversation/syncConversationList", this.getRequestParams(), { userId: this.userId,appId:this.appId,maxLimit:100, lastSequence:lastSequence,operater:this.userId })
resolve(resp);
})
}
public queryMsgDetailsByMessageKey(messageKey:Long): Promise<any> {
return new Promise((resolve, _) => {
let api = new HttpApi(this.httpUrl);
let resp = api.call("/message/queryMsgDetailsByMessageKey", this.getRequestParams(), { appId:this.appId, messageKey:messageKey,operater:this.userId })
resolve(resp);
})
}
public getChatMessageHistoryList(uid:String,offset:Long,limit:Long): Promise<any> {
public getChatMessageHistoryList(uid:String,offset:any,limit:any): Promise<any> {
return new Promise((resolve, _) => {
let api = new HttpApi(this.httpUrl);
let resp = api.call("/message/chatHistory", this.getRequestParams(), { userId: uid,appId:this.appId,offset:offset, limit:limit,operater:this.userId })
@@ -350,6 +334,13 @@ export class ImClient {
})
}
public queryConversationList():Promise<any>{
return new Promise((resolve, _) => {
let api = new HttpApi(this.httpUrl);
let resp = api.call("/message/listMessage", this.getRequestParams(), { userId: this.userId,appId:this.appId,maxLimit:100, lastSequence:0,operater:this.userId })
resolve(resp);
})
}
public createRoom(room:any): Promise<any> {
return new Promise((resolve,_)=>{
@@ -358,6 +349,7 @@ export class ImClient {
return resp;
})
}
public joinRoom(room:any): Promise<any> {
return new Promise((resolve,_)=>{
let api = new HttpApi(this.httpUrl);
@@ -477,6 +469,7 @@ export class ImClient {
}
}
}
export let limLogin = async (url: string, req: LoginPack, imClient: ImClient): Promise<{ success: boolean, err?: Error, conn: w3cwebsocket }> => {

View File

@@ -14,4 +14,4 @@ export class MessageContent {
constructor(messageKey:Long) {
this.messageKey = messageKey;
}
}
}