提交 4e24ab21 编写于 作者: Y yurj26

fix(mp-alipay): 开启globalObjectMode配置报错的bug (question/183499)

上级 ae24da5a
......@@ -5667,11 +5667,12 @@ function getCreateApp() {
: process.env.UNI_SUBPACKAGE
? 'createSubpackageApp'
: 'createApp';
if (typeof global !== 'undefined') {
if (typeof global !== 'undefined' &&
typeof global[method] !== 'undefined') {
return global[method];
}
else if (typeof my !== 'undefined') {
// 支付宝小程序有global
// 支付宝小程序开启globalObjectMode配置后才会有global
return my[method];
}
}
......
......@@ -34,10 +34,13 @@ function getCreateApp() {
: process.env.UNI_SUBPACKAGE
? 'createSubpackageApp'
: 'createApp'
if (typeof global !== 'undefined') {
if (
typeof global !== 'undefined' &&
typeof (global as any)[method] !== 'undefined'
) {
return (global as any)[method]
} else if (typeof my !== 'undefined') {
// 支付宝小程序有global
// 支付宝小程序开启globalObjectMode配置后才会有global
return (my as any)[method]
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册