fix:创建会话未设置当前会话ID

feature/im-0602-ch
ch 3 years ago
parent daac64b0c9
commit 4ca27cdf8a

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-05-18 14:54:47
* @LastEditors: ch
* @LastEditTime: 2022-06-09 19:13:55
* @LastEditTime: 2022-06-10 11:51:45
* @Description: file content
*/
import { CreateUUID, FormatDate, ToAsyncAwait } from "@/common/utils";

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-03-26 14:32:03
* @LastEditors: ch
* @LastEditTime: 2022-06-10 11:38:56
* @LastEditTime: 2022-06-10 11:51:39
* @Description: file content
-->
<template>
@ -137,7 +137,7 @@ export default {
*/
async createSessionMain(){
if(!Im.isOpen){
this.createSessionMain();
setTimeout(()=>this.createSessionMain(),1000);
return false;
}
const {error, result} = await ToAsyncAwait(Im.createSession({
@ -151,6 +151,7 @@ export default {
return false;
}
this.sessionId = result.content.id;
Im.setCurSessionId(this.sessionId);
this.getHistoryMsg();
// this.readMsg();
@ -162,6 +163,7 @@ export default {
this.loading = true;
const {error, result} = await ToAsyncAwait(Im.getHistoryMsg());
if(error){
console.log('----');
uni.$u.toast(error.errMsg || error.message);
return false
}

Loading…
Cancel
Save