提交 42d432f5 authored 作者: 钟是志's avatar 钟是志

错误处理优化

上级 14fe12b9
...@@ -148,7 +148,12 @@ export const request = (url, data, options = {}) => { ...@@ -148,7 +148,12 @@ export const request = (url, data, options = {}) => {
requestType: 'form', requestType: 'form',
...options, ...options,
}).then(response => { })
.then(response => {
console.log(response);
if(response && response.errMsg){
response.errMsg = response.errMsg.slice(0,50);
}
if (response.errCode && response.errCode == '10000') { if (response.errCode && response.errCode == '10000') {
const ul = window.location.href; const ul = window.location.href;
if (ul.indexOf('timeVersion=') == -1) { if (ul.indexOf('timeVersion=') == -1) {
...@@ -239,6 +244,9 @@ export const request = (url, data, options = {}) => { ...@@ -239,6 +244,9 @@ export const request = (url, data, options = {}) => {
requestType: 'form', requestType: 'form',
...options, ...options,
}).then(response => { }).then(response => {
if(response && response.errMsg){
response.errMsg = response.errMsg.slice(0,30) + '...';
}
if (response && response.errCode && response.errCode == '10000') { if (response && response.errCode && response.errCode == '10000') {
const ul = window.location.href; const ul = window.location.href;
if (ul.indexOf('timeVersion=') == -1) { if (ul.indexOf('timeVersion=') == -1) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论