|
@@ -8,6 +8,7 @@ import { studentQueryUserInfo } from "./api";
|
|
|
import { api_cloudLoading, api_getToken } from "../helpers/communication";
|
|
|
import { showToast } from "vant";
|
|
|
import state from "/src/state"
|
|
|
+import { values } from "lodash";
|
|
|
|
|
|
export default defineComponent({
|
|
|
name: "App",
|
|
@@ -143,38 +144,38 @@ export default defineComponent({
|
|
|
*重定向次数:performance.navigation.redirectCount
|
|
|
*重定向耗时: redirectEnd - redirectStart
|
|
|
*/
|
|
|
- window.onload = function() {
|
|
|
- console.log('加载完成')
|
|
|
- let timing: any = performance.getEntriesByType('navigation')[0];
|
|
|
- const { domainLookupEnd, domainLookupStart, connectEnd, connectStart, responseStart,
|
|
|
- requestStart, responseEnd, domInteractive, loadEventStart, domContentLoadedEventEnd,
|
|
|
- fetchStart, secureConnectionStart, transferSize, encodedBodySize,
|
|
|
- redirectEnd, redirectStart
|
|
|
- } = timing
|
|
|
- //console.log(timing.domInteractive);
|
|
|
- //console.log(timing.fetchStart);
|
|
|
- let diff = timing.domInteractive - timing.fetchStart;
|
|
|
- //console.log("TTI: " + diff);
|
|
|
- const timeInfo = [
|
|
|
- { '类型': 'DNS 解析耗时', '耗时': domainLookupEnd - domainLookupStart},
|
|
|
- { '类型': 'TCP 连接耗时', '耗时': connectEnd - connectStart},
|
|
|
- { '类型': 'SSL 安全连接耗时', '耗时': connectEnd - secureConnectionStart},
|
|
|
- { '类型': '网络请求耗时', '耗时': responseStart - requestStart},
|
|
|
- { '类型': '数据传输耗时', '耗时': responseEnd - responseStart},
|
|
|
- { '类型': 'DOM 解析耗时', '耗时': domInteractive - responseEnd},
|
|
|
- { '类型': '资源加载耗时', '耗时': loadEventStart - domContentLoadedEventEnd},
|
|
|
- { '类型': 'First Byte时间', '耗时': responseStart - domainLookupStart},
|
|
|
- { '类型': '白屏时间', '耗时': responseEnd - fetchStart},
|
|
|
- { '类型': '首次可交互时间', '耗时': domInteractive - fetchStart},
|
|
|
- { '类型': 'DOM Ready 时间', '耗时': domContentLoadedEventEnd - fetchStart},
|
|
|
- { '类型': '页面完全加载时间', '耗时': loadEventStart - fetchStart},
|
|
|
- { '类型': 'http 头部大小', '耗时': transferSize - encodedBodySize},
|
|
|
- { '类型': '重定向次数', '耗时': performance.navigation.redirectCount},
|
|
|
- { '类型': '重定向耗时', '耗时': redirectEnd - redirectStart},
|
|
|
- ];
|
|
|
- console.table(timeInfo);
|
|
|
-
|
|
|
- };
|
|
|
+ window.onload = function() {
|
|
|
+ console.log('加载完成')
|
|
|
+ let timing: any = performance.getEntriesByType('navigation')[0];
|
|
|
+ const { domainLookupEnd, domainLookupStart, connectEnd, connectStart, responseStart,
|
|
|
+ requestStart, responseEnd, domInteractive, loadEventStart, domContentLoadedEventEnd,
|
|
|
+ fetchStart, secureConnectionStart, transferSize, encodedBodySize,
|
|
|
+ redirectEnd, redirectStart
|
|
|
+ } = timing
|
|
|
+ //console.log(timing.domInteractive);
|
|
|
+ //console.log(timing.fetchStart);
|
|
|
+ let diff = timing.domInteractive - timing.fetchStart;
|
|
|
+ //console.log("TTI: " + diff);
|
|
|
+ const timeInfo = [
|
|
|
+ { '类型': 'DNS 解析耗时', '耗时': domainLookupEnd - domainLookupStart},
|
|
|
+ { '类型': 'TCP 连接耗时', '耗时': connectEnd - connectStart},
|
|
|
+ { '类型': 'SSL 安全连接耗时', '耗时': connectEnd - secureConnectionStart},
|
|
|
+ { '类型': '网络请求耗时', '耗时': responseStart - requestStart},
|
|
|
+ { '类型': '数据传输耗时', '耗时': responseEnd - responseStart},
|
|
|
+ { '类型': 'DOM 解析耗时', '耗时': domInteractive - responseEnd},
|
|
|
+ { '类型': '资源加载耗时', '耗时': loadEventStart - domContentLoadedEventEnd},
|
|
|
+ { '类型': 'First Byte时间', '耗时': responseStart - domainLookupStart},
|
|
|
+ { '类型': '白屏时间', '耗时': responseEnd - fetchStart},
|
|
|
+ { '类型': '首次可交互时间', '耗时': domInteractive - fetchStart},
|
|
|
+ { '类型': 'DOM Ready 时间', '耗时': domContentLoadedEventEnd - fetchStart},
|
|
|
+ { '类型': '页面完全加载时间', '耗时': loadEventStart - fetchStart},
|
|
|
+ { '类型': 'http 头部大小', '耗时': transferSize - encodedBodySize},
|
|
|
+ { '类型': '重定向次数', '耗时': performance.navigation.redirectCount},
|
|
|
+ { '类型': '重定向耗时', '耗时': redirectEnd - redirectStart},
|
|
|
+ ];
|
|
|
+ console.table(timeInfo);
|
|
|
+
|
|
|
+ };
|
|
|
});
|
|
|
|
|
|
onUnmounted(() => {
|