Commit 35298650 authored by xinzhedeai's avatar xinzhedeai

fix:首页白屏,错误请求重试处理 3次

parent db3670e5
......@@ -44,7 +44,8 @@ window.onload = function() {
accessType: 'manage', // 访问类型 shop商家 saoma 扫码 manage 管理
// 修改默认菜单结构为最小化配置
menuList: [],
remindStatistic: []
remindStatistic: [],
errorReqCount: 0,
}
},
mounted() {
......@@ -151,6 +152,10 @@ window.onload = function() {
var result = JSON.parse(res)
if (result.code !== 200 && result.data == null) {
console.log('getUserInfo=>code200datanull')
if(this.errorReqCount <= 3){
this.errorReqCount++
this.init() // 请求错误后,重新发起请求
}
return
}
this.userInfo = {
......@@ -207,6 +212,15 @@ window.onload = function() {
(res) => {
if (res) {
var result = JSON.parse(res)
if (result.code !== 200 && result.data == null) {
console.log('getStatisticData=>code200datanull')
if(this.errorReqCount <= 3){
this.errorReqCount++
this.init() // 请求错误后,重新发起请求
}
return
}
console.log('用户Data', result)
this.userData = result.data
resolve();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment