| 12345678910111213141516171819202122232425 |
- 'use strict';
- const uniPush = uniCloud.getPushManager({
- appId: "__UNI__33EAA2D"
- })
- exports.main = async (event) => {
- let obj = JSON.parse(event.body);
- switch (obj.action) {
- case 'getClientDetail':
- return getClientDetailByCid(obj.cid)
- default:
- return sendMessage(obj)
- }
- };
- // 推送通知
- async function sendMessage(event) {
- const res = await uniPush.sendMessage(event)
- return res
- }
- // 查询设备的信息
- async function getClientDetailByCid(cid) {
- const res = await uniPush.getClientDetailByCid(cid)
- return res
- }
|