From 66e46962096bbdfe4cb7fa5bfd02578f36de2bd2 Mon Sep 17 00:00:00 2001
From: chenyao <1219716595@qq.com>
Date: Fri, 23 May 2025 16:59:37 +0800
Subject: [PATCH] feat:提交代码
---
src/axios.js | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/axios.js b/src/axios.js
index ddfa769..97e9be0 100644
--- a/src/axios.js
+++ b/src/axios.js
@@ -5,6 +5,7 @@
* isSerialize是否开启form表单提交
* isToken是否需要token
*/
+
import axios from 'axios';
import store from '@/store/';
import router from '@/router/';
@@ -62,6 +63,7 @@
config.url = baseUrl + config.url;
}
//安全请求header
+ config.headers['areaCode'] = store?.state?.user?.userInfo?.detail?.areaCode
config.headers['Blade-Requested-With'] = 'BladeHttpRequest';
//headers判断是否需要
const authorization = config.authorization === false;
@@ -114,7 +116,7 @@
NProgress.done();
const status = res.data.error_code || res.data.code || res.status;
const statusWhiteList = website.statusWhiteList || [];
- const message = res.data.msg || res.data.error_description || '系统错误';
+ const message = res.data.msg || res.data.error_description || res.data.message ||'系统错误';
const config = res.config;
const cryptoData = config.cryptoData === true;
//如果在白名单里则自行catch逻辑处理
@@ -191,7 +193,7 @@
return Promise.reject(new Error(message));
}
// 如果请求为非200默认统一处理
- if (status !== 200) {
+ if (status !== 200 && status !== 0) {
if (!isErrorShown) {
ElMessage({
message: message,
--
Gitblit v1.9.3