diff --git a/packages/uni-stat/dist/uni-cloud-stat.cjs.js b/packages/uni-stat/dist/uni-cloud-stat.cjs.js index d07a7a0de9dea038d39fce959d6996d2bf0cb858..896db9fd346141cf4b149cf04b7c49338bd35348 100644 --- a/packages/uni-stat/dist/uni-cloud-stat.cjs.js +++ b/packages/uni-stat/dist/uni-cloud-stat.cjs.js @@ -505,13 +505,14 @@ const uni_cloud_config = () => { */ const get_space = (config) => { const uniCloudConfig = uni_cloud_config(); - const { spaceId, provider, clientSecret } = uniCloudConfig; - const space_type = ['tcb', 'tencent', 'aliyun']; + const { spaceId, provider, clientSecret ,secretKey,secretId} = uniCloudConfig; + const space_type = ['tcb', 'tencent', 'aliyun','alipay']; const is_provider = space_type.indexOf(provider) !== -1; const is_aliyun = provider === 'aliyun' && spaceId && clientSecret; const is_tcb = (provider === 'tcb' || provider === 'tencent') && spaceId; + const is_alipay = provider === 'alipay' && spaceId && secretKey && secretId; - if (is_provider && (is_aliyun || is_tcb)) { + if (is_provider && (is_aliyun || is_tcb || is_alipay)) { return uniCloudConfig } else { if (config && config.spaceId) { @@ -1348,9 +1349,16 @@ class Stat extends Report { spaceId: space.spaceId, clientSecret: space.clientSecret, }; + if (space.endpoint) { spaceData.endpoint = space.endpoint; } + + if(space.provider === 'alipay'){ + spaceData.secretId = space.secretId; + spaceData.secretKey = space.secretKey; + } + uni.__stat_uniCloud_space = uniCloud.init(spaceData); // console.log( // '=== 当前绑定的统计服务空间spaceId:' + diff --git a/packages/uni-stat/dist/uni-cloud-stat.es.js b/packages/uni-stat/dist/uni-cloud-stat.es.js index 8cd6a8b893afae19824a9dff83bcd43eafd28b95..1d7973cdf5d7bb20156bcf6d338876eabe503152 100644 --- a/packages/uni-stat/dist/uni-cloud-stat.es.js +++ b/packages/uni-stat/dist/uni-cloud-stat.es.js @@ -503,13 +503,14 @@ const uni_cloud_config = () => { */ const get_space = (config) => { const uniCloudConfig = uni_cloud_config(); - const { spaceId, provider, clientSecret } = uniCloudConfig; - const space_type = ['tcb', 'tencent', 'aliyun']; + const { spaceId, provider, clientSecret ,secretKey,secretId} = uniCloudConfig; + const space_type = ['tcb', 'tencent', 'aliyun','alipay']; const is_provider = space_type.indexOf(provider) !== -1; const is_aliyun = provider === 'aliyun' && spaceId && clientSecret; const is_tcb = (provider === 'tcb' || provider === 'tencent') && spaceId; + const is_alipay = provider === 'alipay' && spaceId && secretKey && secretId; - if (is_provider && (is_aliyun || is_tcb)) { + if (is_provider && (is_aliyun || is_tcb || is_alipay)) { return uniCloudConfig } else { if (config && config.spaceId) { @@ -1346,9 +1347,16 @@ class Stat extends Report { spaceId: space.spaceId, clientSecret: space.clientSecret, }; + if (space.endpoint) { spaceData.endpoint = space.endpoint; } + + if(space.provider === 'alipay'){ + spaceData.secretId = space.secretId; + spaceData.secretKey = space.secretKey; + } + uni.__stat_uniCloud_space = uniCloud.init(spaceData); // console.log( // '=== 当前绑定的统计服务空间spaceId:' + diff --git a/packages/uni-stat/src/core/stat.js b/packages/uni-stat/src/core/stat.js index 8ac810c46a458eed38a63b2af5172605da6b5e93..b659207db425c33d8de94cc18581813990406506 100644 --- a/packages/uni-stat/src/core/stat.js +++ b/packages/uni-stat/src/core/stat.js @@ -27,9 +27,16 @@ class Stat extends Report { spaceId: space.spaceId, clientSecret: space.clientSecret, } + if (space.endpoint) { spaceData.endpoint = space.endpoint } + + if(space.provider === 'alipay'){ + spaceData.secretId = space.secretId + spaceData.secretKey = space.secretKey + } + uni.__stat_uniCloud_space = uniCloud.init(spaceData) // console.log( // '=== 当前绑定的统计服务空间spaceId:' + diff --git a/packages/uni-stat/src/utils/pageInfo.js b/packages/uni-stat/src/utils/pageInfo.js index 03f86ab7c3e94c52e8f638e40f7b1375c338f9db..680133fa5476a7dd794c50b6867a9a9b00ce41e5 100644 --- a/packages/uni-stat/src/utils/pageInfo.js +++ b/packages/uni-stat/src/utils/pageInfo.js @@ -475,13 +475,14 @@ export const uni_cloud_config = () => { */ export const get_space = (config) => { const uniCloudConfig = uni_cloud_config() - const { spaceId, provider, clientSecret } = uniCloudConfig - const space_type = ['tcb', 'tencent', 'aliyun'] + const { spaceId, provider, clientSecret ,secretKey,secretId} = uniCloudConfig + const space_type = ['tcb', 'tencent', 'aliyun','alipay'] const is_provider = space_type.indexOf(provider) !== -1 const is_aliyun = provider === 'aliyun' && spaceId && clientSecret const is_tcb = (provider === 'tcb' || provider === 'tencent') && spaceId + const is_alipay = provider === 'alipay' && spaceId && secretKey && secretId - if (is_provider && (is_aliyun || is_tcb)) { + if (is_provider && (is_aliyun || is_tcb || is_alipay)) { return uniCloudConfig } else { if (config && config.spaceId) {