veplayer-mp-wechat
Advanced tools
Comparing version 0.1.17 to 1.0.0
@@ -7,2 +7,4 @@ "use strict"; | ||
const index_1 = require("../tool/index"); | ||
const error_1 = require("../utils/error"); | ||
const index_2 = require("../enums/index"); | ||
exports.default = Behavior({ | ||
@@ -16,5 +18,17 @@ properties: { | ||
} | ||
}, | ||
// 屏蔽日志配置验证,默认false,true的时候可以不配置日志 | ||
disableLogVerify: { | ||
type: Boolean, | ||
value: false | ||
} | ||
}, | ||
data: {}, | ||
lifetimes: { | ||
ready() { | ||
this.initCollector(); | ||
this.updateCollector(this.data); | ||
this.verifyCollector(); | ||
} | ||
}, | ||
methods: { | ||
@@ -46,4 +60,15 @@ initCollector() { | ||
} | ||
}, | ||
// 默认要求配置Collector,不然会报错提醒开发者,这个有利于提高接入日志率 | ||
verifyCollector() { | ||
if (!this.properties.disableLogVerify && !this.collector) { | ||
const message = 'Collector for log not configured'; | ||
const error = new error_1.XGError(error_1.ErrorCategory.Collector, index_2.ErrorCodes.Collector_NOT_CONFIGURED, message); | ||
error.severity = error_1.ErrorSeverity.INTERRUPTED; | ||
this.setData({ | ||
error: error | ||
}); | ||
} | ||
} | ||
} | ||
}); |
@@ -8,2 +8,6 @@ "use strict"; | ||
ErrorCodes[ErrorCodes["Component_LIFETIME_ERROR"] = 1] = "Component_LIFETIME_ERROR"; | ||
/** | ||
* 日志未配置 | ||
*/ | ||
ErrorCodes[ErrorCodes["Collector_NOT_CONFIGURED"] = 9] = "Collector_NOT_CONFIGURED"; | ||
//////////////////////////////////////////////////////////////////////// | ||
@@ -10,0 +14,0 @@ //////////////////////// 1000 -> 1999 = MEDIA ////////////////////////// |
@@ -206,4 +206,2 @@ "use strict"; | ||
!!controls && this.focusPlayer(); | ||
this.initCollector(); | ||
this.updateCollector(this.data); | ||
}, | ||
@@ -210,0 +208,0 @@ /** |
@@ -20,2 +20,4 @@ "use strict"; | ||
ErrorCategory[ErrorCategory["SERVICE"] = 2] = "SERVICE"; | ||
/** Log Colector not configured. */ | ||
ErrorCategory[ErrorCategory["Collector"] = 3] = "Collector"; | ||
})(ErrorCategory = exports.ErrorCategory || (exports.ErrorCategory = {})); | ||
@@ -22,0 +24,0 @@ /** |
{ | ||
"name": "veplayer-mp-wechat", | ||
"version": "0.1.17", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "miniprogram": "dist", |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
129032
2066
1