From 1f7fe16d25c6cd52b7efe1888625b0edb834c877 Mon Sep 17 00:00:00 2001 From: anne-xml Date: Tue, 19 Nov 2024 17:14:14 +0800 Subject: [PATCH] =?UTF-8?q?uni-push=E7=A4=BA=E4=BE=8B=E6=96=B0=E5=A2=9Eweb?= =?UTF-8?q?=E7=AB=AF=E5=92=8C=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/API/uni-push/uni-push.uvue | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/pages/API/uni-push/uni-push.uvue b/pages/API/uni-push/uni-push.uvue index abf640aa..1fa0420f 100644 --- a/pages/API/uni-push/uni-push.uvue +++ b/pages/API/uni-push/uni-push.uvue @@ -1,6 +1,9 @@ @@ -129,7 +133,12 @@ content: `cid : ${res.cid}` }) }, - fail: () => { + fail: (err) => { + if (err.message.includes('uniPush is not enabled')) { + console.error('请先开通uni-push,详见文档:https://uniapp.dcloud.net.cn/unipush-v2.html#%E7%AC%AC%E4%B8%80%E6%AD%A5-%E5%BC%80%E9%80%9A'); + } else { + console.error(err); + } uni.hideLoading() uni.showToast({ title: `获取cid失败`, -- GitLab