提交 1f40db30 编写于 作者: M mehaotian

fix(stat): 优化提示信息

上级 a3c2ba0d
......@@ -55,9 +55,10 @@ var index = () => [
// ssr 时不开启
if (!uniCliShared.isSsr(env.command, config)) {
const statConfig = uniCliShared.getUniStatistics(inputDir, platform);
isEnable = statConfig.enable === true;
if (isEnable) {
const uniCloudConfig = statConfig.uniCloud || {};
statVersion = statConfig.version === '2' ? '2' : '1';
isEnable = statConfig.enable === true;
process.env.UNI_STAT_UNI_CLOUD = JSON.stringify(uniCloudConfig);
process.env.UNI_STAT_DEBUG = statConfig.debug ? 'true' : 'false';
if (process.env.NODE_ENV === 'production') {
......@@ -70,19 +71,20 @@ var index = () => [
if (!statConfig.version) {
uniStatLog(uniCliShared.M['stat.warn.version']);
}
if (isEnable) {
else {
uniStatLog(`已开启 uni统计${statVersion}.0 版本`);
}
}
}
else {
if (isEnable) {
if (!statConfig.version) {
uniStatLog(uniCliShared.M['stat.warn.version']);
}
else {
uniStatLog(uniCliShared.M['stat.warn.tip'].replace('{version}', `${statVersion}.0`));
}
}
}
debug__default["default"]('uni:stat')('isEnable', isEnable);
}
process.env.UNI_STAT_TITLE_JSON = JSON.stringify(titlesJson);
......
......@@ -51,10 +51,12 @@ export default () => [
// ssr 时不开启
if (!isSsr(env.command, config)) {
const statConfig = getUniStatistics(inputDir, platform)
const uniCloudConfig = statConfig.uniCloud || {}
statVersion = statConfig.version === '2' ? '2' : '1'
isEnable = statConfig.enable === true
if (isEnable) {
const uniCloudConfig = statConfig.uniCloud || {}
statVersion = statConfig.version === '2' ? '2' : '1'
process.env.UNI_STAT_UNI_CLOUD = JSON.stringify(uniCloudConfig)
process.env.UNI_STAT_DEBUG = statConfig.debug ? 'true' : 'false'
if (process.env.NODE_ENV === 'production') {
......@@ -65,21 +67,20 @@ export default () => [
} else {
if (!statConfig.version) {
uniStatLog(M['stat.warn.version'])
}
if (isEnable) {
} else {
uniStatLog(`已开启 uni统计${statVersion}.0 版本`)
}
}
} else {
if (isEnable) {
if (!statConfig.version) {
uniStatLog(M['stat.warn.version'])
}
} else {
uniStatLog(
M['stat.warn.tip'].replace('{version}', `${statVersion}.0`)
)
}
}
}
debug('uni:stat')('isEnable', isEnable)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册