提交 dfa46c6f 编写于 作者: 雪洛's avatar 雪洛

feat(uniCloud): prefer UNI_CLOUD_PROVIDER over UNI_CLOUD_SPACES

上级 096483a5
......@@ -21,7 +21,7 @@ if (process.env.UNI_INPUT_DIR && process.env.UNI_INPUT_DIR.indexOf('./') === 0)
process.env.UNI_INPUT_DIR = process.env.UNI_INPUT_DIR || path.resolve(process.cwd(), defaultInputDir)
const {
getManifestJson,
getManifestJson,
isEnableUniPushV1,
isEnableUniPushV2,
isUniPushOffline
......@@ -66,8 +66,6 @@ process.env.VUE_APP_NAME = manifestJsonObj.name
process.env.UNI_USING_V3_SCOPED = true
process.env.UNI_CLOUD_PROVIDER = JSON.stringify([])
// 导出到小程序插件
process.env.UNI_MP_PLUGIN_EXPORT = JSON.stringify(Object.keys(platformOptions.plugins || {}).map(pluginName =>
platformOptions.plugins[pluginName].export))
......@@ -75,7 +73,9 @@ process.env.UNI_MP_PLUGIN_EXPORT = JSON.stringify(Object.keys(platformOptions.pl
const isH5 = !process.env.UNI_SUB_PLATFORM && process.env.UNI_PLATFORM === 'h5'
const isProduction = process.env.NODE_ENV === 'production'
if (process.env.UNI_CLOUD_SPACES) {
// uniCloud
if (!process.env.UNI_CLOUD_PROVIDER && process.env.UNI_CLOUD_SPACES) {
process.env.UNI_CLOUD_PROVIDER = JSON.stringify([])
try {
const spaces = JSON.parse(process.env.UNI_CLOUD_SPACES)
if (Array.isArray(spaces)) {
......@@ -561,4 +561,4 @@ runByHBuilderX && console.log(uniI18n.__('compiling'))
module.exports = {
manifestPlatformOptions: platformOptions
}
}
......@@ -628,12 +628,12 @@ function initUniStatistics (manifestJson) {
)
delete manifestJson.uniStatistics
}
if (!process.env.UNI_CLOUD_SPACES) {
if (!process.env.UNI_CLOUD_PROVIDER) {
return
}
let spaces = []
try {
spaces = JSON.parse(process.env.UNI_CLOUD_SPACES)
spaces = JSON.parse(process.env.UNI_CLOUD_PROVIDER)
} catch (e) {}
if (!Array.isArray(spaces) || !spaces.length) {
return
......@@ -652,9 +652,9 @@ function initUniStatistics (manifestJson) {
}
uniStatistics.uniCloud = {
provider: space.provider,
spaceId: space.id,
spaceId: space.spaceId,
clientSecret: space.clientSecret,
endpoint: space.apiEndpoint
endpoint: space.endpoint
}
}
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册