@tmsfe/tms-core 0.0.57 → 0.0.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/report/sender.ts +4 -3
- package/src/timeUtils.js +2 -2
package/package.json
CHANGED
package/src/report/sender.ts
CHANGED
|
@@ -49,10 +49,11 @@ function batchSendData(): void {
|
|
|
49
49
|
const request = helper.getTms().createRequest();
|
|
50
50
|
request.post('basic/event/upload', { batch })
|
|
51
51
|
.then((res: any) => {
|
|
52
|
-
if (res.errCode
|
|
53
|
-
requestFail(batch);
|
|
54
|
-
} else {
|
|
52
|
+
if (res.errCode === 0) {
|
|
55
53
|
startTimer();
|
|
54
|
+
} else if (res.errMsg !== 'Invalid or expired session!') {
|
|
55
|
+
// 如果是多端登录了,就不要再发了
|
|
56
|
+
requestFail(batch);
|
|
56
57
|
}
|
|
57
58
|
})
|
|
58
59
|
.catch((e: any) => {
|
package/src/timeUtils.js
CHANGED
|
@@ -153,8 +153,8 @@ const formatDateTime = (date, fmt = 'yyyy-MM-dd hh:mm:ss') => {
|
|
|
153
153
|
*/
|
|
154
154
|
const dateToString = (date, withTime = false, withSeconds = false, join = '-') => {
|
|
155
155
|
let fmt = `yyyy${join}MM${join}dd`;
|
|
156
|
-
if (withTime) fmt += withSeconds ? 'hh:mm:ss' : 'hh:mm';
|
|
157
|
-
return formatDateTime(date, fmt);
|
|
156
|
+
if (withTime) fmt += withSeconds ? ' hh:mm:ss' : ' hh:mm';
|
|
157
|
+
return formatDateTime(date || new Date(), fmt);
|
|
158
158
|
};
|
|
159
159
|
|
|
160
160
|
export {
|