Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
myRouter.afterEach((to, from) => {
LoadingBar.finish()
})
for (let i in data.data.data) {
errmsg += data.data.data[i] + ';'
}
break
default:
errmsg = data.data.errmsg
break
}
if (errmsg !== '' && errno !== 0) {
Message.error(errmsg)
}
if (errmsg !== '' && errno === 0) {
Message.success(errmsg)
}
}
LoadingBar.finish()
return data
}, error => {
let errmsg = '服务器响应错误'
for (let i in data.data.data) {
errmsg += data.data.data[i] + ";";
}
break;
default:
errmsg = data.data.errmsg;
break;
}
if (errmsg != "" && errno != 0) {
Message.error(errmsg);
}
if (errmsg != "" && errno == 0) {
Message.success(errmsg);
}
}
LoadingBar.finish();
return data;
}, error => {
let errmsg = "服务器响应错误";
return next(false)
}
next()
}
}
} else if (to.matched.some(r => (r.meta && r.meta.auth))) {
next({
name: 'login',
query: {
redirect: to.path,
},
})
} else {
next()
}
LoadingBar.finish()
})