对接消息推送

This commit is contained in:
zhouyanli
2026-06-01 11:38:03 +08:00
parent fbe07e21a6
commit 3fa853cb4c
6 changed files with 41 additions and 30 deletions

View File

@@ -138,4 +138,8 @@ export const addVisitorData = (data) =>{
// 上传单张图片
export const uploadFile = (filePath) => {
return upload(filePath,'/api/resident/file/uploadImage');
}
}
// 单推消息推送
export const getPushSingle = (data) =>{
return post("/api/push/single", data)
}

View File

@@ -186,10 +186,12 @@ const handleLogin = () => {
return;
}
uni.showLoading({ title: '登录中...', mask: true });
const push_cid = uni.getStorageSync('push_cid')
let params = {
phone:phoneNumber.value,
smsCode:verifyCode.value,
scene:'login',
cid:push_cid
}
getLoginBySms(params).then(res =>{
if(res.code === 200){
@@ -204,6 +206,7 @@ const handleLogin = () => {
uni.setStorageSync('currentVillageId', currentVillageId);
uni.hideLoading();
uni.showToast({ title: '登录成功', icon: 'success' });
setTimeout(() =>{
uni.switchTab({ url: '/pages/index/index' });
},1500)
@@ -231,6 +234,14 @@ const handleLogin = () => {
// title:"登录成功",
// icon:'success'
// })
// 登录成功后上报推送 CID
// #ifdef APP-PLUS
const cid = uni.getStorageSync('push_cid')
if (cid) {
reportPushCID(cid)
}
// #endif
// setTimeout(() =>{
// uni.switchTab({ url: '/pages/index/index' });
// },1500)

View File

@@ -134,9 +134,11 @@ const handleLogin = () => {
return;
}
uni.showLoading({ title: '登录中...', mask: true });
const push_cid = uni.getStorageSync('push_cid')
let params = {
username:phoneNumber.value,
password:password.value
password:password.value,
cid:push_cid
}
getLoginPassword(params).then(res =>{
if(res.code === 200){