Comparing version 1.3.3 to 1.3.5
{ | ||
"name": "fengui", | ||
"version": "1.3.3", | ||
"version": "1.3.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -6,3 +6,4 @@ import $ from 'jquery' | ||
import browserEnv from './browserEnv' | ||
import performance from './performance' | ||
import PerfClient from './perfClient' | ||
var baseUrl = '/api' | ||
@@ -12,5 +13,14 @@ | ||
function sendAjaxTime (url, status) { | ||
let totalTime = performance.end() | ||
let perfClient = new PerfClient() | ||
perfClient.sendAjaxTime(url, totalTime, status) | ||
} | ||
function parseResponse (jqResult, url) { | ||
performance.start() | ||
return Promise.resolve(jqResult).then(function (result) { | ||
const originError = result.error | ||
sendAjaxTime(url,'200') | ||
@@ -39,2 +49,4 @@ if (!originError) { | ||
}, function (error) { | ||
sendAjaxTime(url,'') | ||
var status = error.status | ||
@@ -41,0 +53,0 @@ analysis.trackEventValue('re_apiv2_status_error', {url, status}) |
126010
76
2508