t-lj-service 1.0.5 → 1.0.7
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/module/config.ts +4 -1
- package/module/hooks.ts +1 -1
- package/package.json +1 -1
package/module/config.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import hooks from './hooks';
|
|
2
2
|
const BASE_URL = import.meta.env.MODE === 'dev' ? '/api' : hooks.getLocal("sessioncurraddr") || '';
|
|
3
|
-
const TIME_OUT =
|
|
3
|
+
const TIME_OUT = 10 * 1000;
|
|
4
4
|
export enum REQUEST_METHOD {
|
|
5
5
|
POST = 'post',
|
|
6
6
|
GET = 'get',
|
|
@@ -73,6 +73,9 @@ const RequestConfig = (config: any): any => {
|
|
|
73
73
|
if(config.Token !== undefined ){
|
|
74
74
|
config.headers['Token'] = config.Token;
|
|
75
75
|
}
|
|
76
|
+
if(config.Timeout !== undefined ){
|
|
77
|
+
config.timeout = Number(config.Timeout) * 1000;
|
|
78
|
+
}
|
|
76
79
|
hooks.setLocal('sessiononlineTime', new Date().toString());
|
|
77
80
|
return config;
|
|
78
81
|
}
|
package/module/hooks.ts
CHANGED
|
@@ -439,7 +439,7 @@ export const formatTimeArray = (time: string): any => {
|
|
|
439
439
|
hours: padStart(hours),
|
|
440
440
|
minutes: padStart(minutes),
|
|
441
441
|
seconds: padStart(seconds),
|
|
442
|
-
milliseconds: padStart(milliseconds || 0),
|
|
442
|
+
milliseconds: padStart(((milliseconds || 0) * 100).toString().slice(0, 2)),
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
445
|
export const formatTime = (seconds: number, show: boolean = false): string => {
|