From faab5b2bd175f18259d79ca50236534346472f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Thu, 10 Jul 2025 16:36:17 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E6=8E=A8=E9=80=81=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App.vue | 52 +++++++++++-------------- manifest.json | 3 +- pages/login/index.vue | 91 ++++++++++++++++++++++++++++--------------- 3 files changed, 84 insertions(+), 62 deletions(-) diff --git a/App.vue b/App.vue index fc46699..e014cf5 100644 --- a/App.vue +++ b/App.vue @@ -30,41 +30,33 @@ export default { console.error(`暂时不支持运行到小程序端`); // #endif // 集成cid全局获取和存储 - uni.getPushClientId({ - success: (res) => { - console.log(res, 'app-Push-ID'); - if (res && res.cid) { - uni.setStorageSync('cid', res.cid); - } - }, - fail: (err) => { - console.log(err) - } - }) + // uni.getPushClientId({ + // success: (res) => { + // console.log(res, 'app-Push-ID'); + // if (res && res.cid) { + // uni.setStorageSync('cid', res.cid); + // } + // }, + // fail: (err) => { + // console.log(err) + // } + // }) }, onShow: function () { console.log("App Show"); IMSDK.asyncApi(IMSDK.IMMethods.SetAppBackgroundStatus, IMSDK.uuid(), false); - uni.getPushClientId({ - success(res) { - console.log(res, 'app-Push-ID'); - }, - fail(err) { - console.log(err) - } - }) //#ifdef APP-PLUS - var info = plus.push.getClientInfo() - plus.push.addEventListener("click", function(msg) { - console.log("click:" + JSON.stringify(msg)); - console.log(msg.payload); - console.log(JSON.stringify(msg)); - }, false); - // 监听在线消息事件 - plus.push.addEventListener("receive", function(msg) { - //业务代码 - console.log("recevice:" + JSON.stringify(msg)) - }, false); + // var info = plus.push.getClientInfo() + // plus.push.addEventListener("click", function(msg) { + // console.log("click:" + JSON.stringify(msg)); + // console.log(msg.payload); + // console.log(JSON.stringify(msg)); + // }, false); + // // 监听在线消息事件 + // plus.push.addEventListener("receive", function(msg) { + // //业务代码 + // console.log("recevice:" + JSON.stringify(msg)) + // }, false); //#endif diff --git a/manifest.json b/manifest.json index 3999c3e..999013a 100644 --- a/manifest.json +++ b/manifest.json @@ -74,7 +74,8 @@ "speech" : {}, "push" : { "unipush" : { - "offline" : true + "offline" : true, + "oppo" : {} } } }, diff --git a/pages/login/index.vue b/pages/login/index.vue index 7bc26d6..88ea34f 100644 --- a/pages/login/index.vue +++ b/pages/login/index.vue @@ -216,42 +216,71 @@ export default { this.$store.dispatch("contact/getSentFriendApplications"); this.$store.dispatch("contact/getRecvGroupApplications"); this.$store.dispatch("contact/getSentGroupApplications"); + // 登录成功后,绑定deviceId与imId + // 获取设备cid,调用云函数 + // const cid = uni.getStorageSync('cid'); + // uniCloud.callFunction({ + // name: 'bindingIm', + // data: { + // deviceId: cid, + // imId: userID + // }, + // success: (res) => { + // if (res.result.code === 200) { + // uni.showToast({ + // title: res.result.msg, + // icon: 'success' + // }); + // } else { + // uni.showToast({ + // title: res.result.msg, + // icon: 'none' + // }); + // } + // }, + // fail: (err) => { + // uni.showToast({ + // title: '云函数调用失败', + // icon: 'none' + // }); + // console.error(err); + // } + // }); uni.switchTab({ url: "/pages/conversation/conversationList/index", }); await getSMSCodeFromOa(this.loginInfo.phoneNumber); const info = await loginOaByPhone(this.loginInfo.phoneNumber) - console.log('用户信息', info) - const oaUserId = info.userInfo.userId; - // 获取设备cid,调用云函数 - const cid = uni.getStorageSync('cid'); - uniCloud.callFunction({ - name: 'binding', - data: { - oaId: oaUserId, - deviceId: cid - }, - success: (res) => { - if (res.result.code === 200) { - uni.showToast({ - title: res.result.msg, - icon: 'success' - }); - } else { - uni.showToast({ - title: res.result.msg, - icon: 'none' - }); - } - }, - fail: (err) => { - uni.showToast({ - title: '云函数调用失败', - icon: 'none' - }); - console.error(err); - } - }); + // console.log('用户信息', info) + // const oaUserId = info.userInfo.userId; + + // uniCloud.callFunction({ + // name: 'binding', + // data: { + // oaId: oaUserId, + // deviceId: cid + // }, + // success: (res) => { + // if (res.result.code === 200) { + // uni.showToast({ + // title: res.result.msg, + // icon: 'success' + // }); + // } else { + // uni.showToast({ + // title: res.result.msg, + // icon: 'none' + // }); + // } + // }, + // fail: (err) => { + // uni.showToast({ + // title: '云函数调用失败', + // icon: 'none' + // }); + // console.error(err); + // } + // }); this.loginInfo.password = ""; this.loading = false;