|
...
|
...
|
@@ -9,40 +9,7 @@ const api_timeout = 2000; //接口超时时间,默认2s |
|
|
|
import api from './api.url'
|
|
|
|
import uri_dc from './uri'
|
|
|
|
const server_host = uri_dc.HOST__LINE;
|
|
|
|
/**
|
|
|
|
* @param data
|
|
|
|
* @param status started, succeeded (default), failed, or timed_out
|
|
|
|
*/
|
|
|
|
function rollbar(data) {
|
|
|
|
// let raw=JSON.stringify(data)
|
|
|
|
// let trace={
|
|
|
|
// frames:[data],
|
|
|
|
// exception:{class:raw},
|
|
|
|
// }
|
|
|
|
let param={
|
|
|
|
access_token: '83bd2afd09b8402b943cb1894a84ec51',
|
|
|
|
data:{
|
|
|
|
body:{
|
|
|
|
//trace:trace,
|
|
|
|
// trace_chain:[trace],
|
|
|
|
message:{
|
|
|
|
body:data,
|
|
|
|
},
|
|
|
|
// crash_report:{
|
|
|
|
// raw:raw
|
|
|
|
// },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
wx.request({
|
|
|
|
url: 'https://api.rollbar.com/api/1/item/',
|
|
|
|
method: 'POST',
|
|
|
|
data: param,
|
|
|
|
header: {
|
|
|
|
//'content-type': 'application/x-www-form-urlencoded'
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|
|
|
|
import rollbar from './rollbar'
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param act
|
|
...
|
...
|
@@ -122,11 +89,7 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr |
|
|
|
cache(cache_key, res.data, cachetime);//.then().catch();
|
|
|
|
}
|
|
|
|
if (res.data.ret !== 200) {
|
|
|
|
try {
|
|
|
|
res.data.msg = res.data.msg.replace('非法请求:', '');
|
|
|
|
} catch (e) {
|
|
|
|
console.log('res-fail', res, e);
|
|
|
|
}
|
|
|
|
res.data.msg = res.data.msg.replace('非法请求:', '');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
success(res.data);
|
|
...
|
...
|
@@ -137,7 +100,8 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr |
|
|
|
formids: formids.toString(),
|
|
|
|
operator: operator,
|
|
|
|
post_data:cache_key,
|
|
|
|
response:res
|
|
|
|
response:res,
|
|
|
|
catch:JSON.stringify(e),
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
...
|
...
|
|