refactor(im): 对齐文赫电竞消息系统(配对群ID+稳定监听)

This commit is contained in:
XingQue
2026-06-29 04:20:39 +08:00
parent 9976bc1d6d
commit 6e2f7bc39f
7 changed files with 191 additions and 51 deletions

View File

@@ -2,7 +2,7 @@
import GoEasy from '../static/lib/goeasy-2.13.24.esm.min';
import { jianquanxian } from './imAuth/jianquanxian';
import { parseOrderCardText } from './group-chat.js';
import { persistGroupMeta, getFreshImUser, getImUserIdForRole } from './im-user.js';
import { persistGroupMeta, getFreshImUser, getImUserIdForRole, getLocalImUserId, getLocalImIdentity } from './im-user.js';
let _globalPrivateHandler = null;
let _globalGroupHandler = null;
@@ -82,9 +82,11 @@ function getCurrentGoEasyUserId() {
}
function getExpectedImUserId(app) {
const fromLocal = getLocalImUserId(app);
if (fromLocal) return fromLocal;
const uid = wx.getStorageSync('uid');
if (!uid) return '';
const role = app.globalData.currentRole || 'normal';
const role = app.globalData.currentRole || getLocalImIdentity(app) || 'normal';
return getImUserIdForRole(role, uid);
}