jiangping
2025-07-07 9a0e2661c69fea29a0a53ecdf9e11333da9b9615
h5/uni.promisify.adaptor.js
对比新文件
@@ -0,0 +1,13 @@
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) => {
        if (!res) return resolve(res)
        return res[0] ? reject(res[0]) : resolve(res[1])
      });
    });
  },
});