axios设置一下就好了
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>BFW NEW PAGE</title>
<script type="text/javascript" src="//repo.bfw.wiki/bfwrepo/js/axios-0.18.js"></script>
<script type="text/javascript" charset="utf-8">
const axiosInstance = axios.create({
timeout: 2000,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Requested-With': 'XMLHttpRequest'
}
})
function interceptAjax(res) {
alert("拦截到了");
return {};
const tmp = res.headers['exceptionaction'];
if (!tmp) return res;
//系统已经登陆
const token = RxUtil.getCache('token');
if (!token) {
router.push({
name: 'login'
});
return;
}
}
axiosInstance.interceptors.response.use(res => interceptAjax(res));
axiosInstance.get('/').
then(response => {
console.log(response);
}).
catch(e => {
console.log(e);
});
</script>
<style>
</style>
</head>
<body>
</body>
</html>
网友回复
未来手机或电脑无应用,全部内置ai,ai实时生成ui界面帮你干活?
标准拉丁字母a与俄文西里尔a看上去一样却不相等?
CodeGraph与RTK(Rust Token Killer)有啥区别?
python如何将svg图标转换成png图片?
windows如何设置让多个人同时远程桌面连接同一台电脑同时可操作不被踢出?
什么是WebRCD技术?
如何在centos的服务器docker上安装运行微信qq?
如何用ai图片模型祛除图片油腻感?
google的gemini-omni多模态大模型在哪可以免费体验?
google的Antigravity 、Antigravity CLI、Antigravity IDE、Antigravity SDK有啥区别不同?


