From bbed6e5fa09055343b84a2f251852da831231280 Mon Sep 17 00:00:00 2001 From: magic Date: Sat, 14 Sep 2024 10:42:20 +0800 Subject: [PATCH] fix bug --- README.md | 4 ++++ package.json | 2 +- src/lib/bmob.js | 10 +++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 64b3f00..8eb39d2 100644 --- a/README.md +++ b/README.md @@ -108,6 +108,10 @@ Bmob.initialize("你的Application ID", "你的REST API Key"); https://bmob.github.io/hydrogen-js-sdk/#/?id=登陆 + +#### 版本 v2.6.0 2024年09月14日10:42:04 +> - 修复vue3的兼容问题 + #### 版本 v2.5.30 > - 增加支持微信文字检测违规2.0 diff --git a/package.json b/package.json index 214d3fe..5da08ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hydrogen-js-sdk", - "version": "2.5.30", + "version": "2.6.0", "description": "本SDK基于es6开发,致力打造基于前端混合开发需求,支持微信小程序、H5、快应用、游戏Cocos、混合App等平台, 整个SDK,就dist目录下Bmob.*.js 这个文件即可使用全部功能,请使用最新版本。", "main": "./index.js", "typings": "./index.d.ts", diff --git a/src/lib/bmob.js b/src/lib/bmob.js index b840b4b..95a6fa2 100644 --- a/src/lib/bmob.js +++ b/src/lib/bmob.js @@ -1,9 +1,13 @@ const utils = require('./utils') -if (typeof global==='undefined'){ - global=window +let env +if (utils.getAppType() === 'h5') { + env = window } -const Bmob = global.Bmob || {} +if (utils.getAppType() === 'nodejs') { + env = global +} +const Bmob = env.Bmob || {} Bmob.utils = utils Bmob._config = utils.getConfig()