From a09099de00d6c13ebdaefb97f4c119948d73a7a3 Mon Sep 17 00:00:00 2001
From: quanyawei <401863037@qq.com>
Date: Mon, 06 Nov 2023 17:33:47 +0800
Subject: [PATCH] fix:小程序订阅消息
---
uni.promisify.adaptor.js | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/uni.promisify.adaptor.js b/uni.promisify.adaptor.js
new file mode 100644
index 0000000..47fbce1
--- /dev/null
+++ b/uni.promisify.adaptor.js
@@ -0,0 +1,10 @@
+uni.addInterceptor({
+ returnValue (res) {
+ if (!(!!res && (typeof res === "object" || typeof res === "function") && typeof res.then === "function")) {
+ return res;
+ }
+ return new Promise((resolve, reject) => {
+ res.then((res) => res[0] ? reject(res[0]) : resolve(res[1]));
+ });
+ },
+});
\ No newline at end of file
--
Gitblit v1.8.0