提交 86ba0433 编写于 作者: M mehaotian

fix(stat): uni-stat tips

上级 ef4f0fc4
......@@ -54,6 +54,7 @@
"pluginUni.pluginNameNotExist": "Plug-in name does not exist",
"pluginUni.pluginIllegal": "The plugin is illegal",
"pluginUni.uniStatisticsNoAppid": "The current application is not configured with Appid, and uni statistics cannot be used. For details, see {{0}}",
"pluginUni.uniStatisticsNoVersion": "The uni statistics version is not configured. The default version is 1.0.uni statistics version 2.0 is recommended, private deployment data is more secure and code is open source and customizable. details:{{0}} ",
"pluginUni.pleaseConfigScriptName": "Please specify the script name under package.json->uni-app->scripts",
"pluginUni.mpBrowserKernelDifference": "There are differences in the implementation mechanism of the browser kernels and custom components of each mini-program, and there may be compatibility issues with styles and layouts, please refer to: {{0}}",
"mpLoader.firstParameterNeedStaticString": "The first parameter of {{0}} must be a static string",
......
......@@ -54,6 +54,7 @@
"pluginUni.pluginNameNotExist": "插件名称不存在",
"pluginUni.pluginIllegal": "插件不合法",
"pluginUni.uniStatisticsNoAppid": "当前应用未配置Appid,无法使用uni统计,详情参考 {{0}}",
"pluginUni.uniStatisticsNoVersion": "当前应用未配置uni统计版本,默认使用1.0版本;建议使用uni统计2.0版本 ,私有部署数据更安全,代码开源可定制。详情 {{0}}",
"pluginUni.pleaseConfigScriptName": "请指定 package.json->uni-app->scripts 下的 script 名称",
"pluginUni.mpBrowserKernelDifference": "小程序各家浏览器内核及自定义组件实现机制存在差异,可能存在样式布局兼容问题,参考:{{0}}",
"mpLoader.firstParameterNeedStaticString": "{{0}}的第一个参数必须为静态字符串",
......
......@@ -309,13 +309,23 @@ if (
)
if (uniStatistics.enable === true) {
process.env.UNI_USING_STAT = uniStatistics.version === '2' ? '2' : '1'
if (!process.UNI_STAT_CONFIG.appid && process.env.NODE_ENV === 'production') {
console.log()
console.warn(uniI18n.__('pluginUni.uniStatisticsNoAppid', {
0: 'https://ask.dcloud.net.cn/article/36303'
}))
console.log()
process.env.UNI_USING_STAT = uniStatistics.version === '2' ? '2' : '1'
if (process.env.NODE_ENV === 'production') {
if (!process.UNI_STAT_CONFIG.appid) {
console.log()
console.warn(uniI18n.__('pluginUni.uniStatisticsNoAppid', {
0: 'https://ask.dcloud.net.cn/article/36303'
}))
console.log()
} else {
if(!uniStatistics.version) {
console.log()
console.warn(uniI18n.__('pluginUni.uniStatisticsNoVersion', {
0: 'https://uniapp.dcloud.io/uni-stat'
}))
console.log()
}
}
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册