吉安感知网项目-前端
张含笑
2026-02-09 526db8f972c2a8d822c4d05bb1b73458dc221291
feat:调整
1 files modified
30 ■■■■ changed files
applications/mobile-web-view/src/appPages/voiceCallDetail/index.vue 30 ●●●● patch | view | raw | blame | history
applications/mobile-web-view/src/appPages/voiceCallDetail/index.vue
@@ -76,26 +76,26 @@
    }
    
    // 2. 同时保留原有的URL参数解析逻辑,作为备选
    // const url = new URL(window.location.href);
    // const paramsStr = url.searchParams.get('params');
    // if (paramsStr) {
    //     try {
    //         const params = JSON.parse(decodeURIComponent(paramsStr));
    //         if (params.peerUid) {
    //             peerUid.value = String(params.peerUid);
    //             log('🔗 从URL参数获取peerUid:', params.peerUid);
    //         }
    //     } catch (e) {
    //         log('❌ 解析URL参数失败:', String(e));
    //     }
    // }
    const url = new URL(window.location.href);
    const paramsStr = url.searchParams.get('params');
    if (paramsStr) {
        try {
            const params = JSON.parse(decodeURIComponent(paramsStr));
            if (params.peerUid) {
                peerUid.value = String(params.peerUid);
                log('🔗 从URL参数获取peerUid:', params.peerUid);
            }
        } catch (e) {
            log('❌ 解析URL参数失败:', String(e));
        }
    }
}
// 从URL参数或本地存储获取用户ID
const getUserIdFromStorage = () => {
    // 从url获取用户id
    const contact = JSON.parse(decodeURIComponent(receiveParameters.value)).userId
    console.log('从url获取用户id',contact)
    const contact = JSON.parse(decodeURIComponent(receiveParameters.value))
    console.log('从url获取用户id',contact?.userId)
    // 从本地获取用户id
    const userId = localStorage.getItem('userId') || sessionStorage.getItem('userId')
    console.log('从本地存储获取userId:', userId)