You've already forked template-MP
新增 错误上报功能增加项目名称和版本号信息
This commit is contained in:
@@ -33,7 +33,7 @@ class Tool {
|
|||||||
// 项目信息
|
// 项目信息
|
||||||
this.projectInfo = {
|
this.projectInfo = {
|
||||||
name: 'template',
|
name: 'template',
|
||||||
version: '1.0.0'
|
version: '1.0.0',
|
||||||
}
|
}
|
||||||
|
|
||||||
// 尝试从 manifest.json 加载项目信息
|
// 尝试从 manifest.json 加载项目信息
|
||||||
@@ -826,13 +826,10 @@ class Tool {
|
|||||||
*/
|
*/
|
||||||
_loadProjectInfo() {
|
_loadProjectInfo() {
|
||||||
try {
|
try {
|
||||||
// 尝试加载 manifest.json 信息
|
if (uni.getSystemInfoSync()) {
|
||||||
const manifest = require('../../manifest.json')
|
const AppInfo = uni.getSystemInfoSync()
|
||||||
if (manifest.name) {
|
this.projectInfo.name = AppInfo.appName
|
||||||
this.projectInfo.name = manifest.name
|
this.projectInfo.version = AppInfo.appVersion
|
||||||
}
|
|
||||||
if (manifest.versionName) {
|
|
||||||
this.projectInfo.version = manifest.versionName
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// 如果加载失败,使用默认信息
|
// 如果加载失败,使用默认信息
|
||||||
|
|||||||
Reference in New Issue
Block a user