diff --git a/src/utils/http/axios/index.ts b/src/utils/http/axios/index.ts index b408238..c993c78 100644 --- a/src/utils/http/axios/index.ts +++ b/src/utils/http/axios/index.ts @@ -25,11 +25,13 @@ const { createMessage, createErrorModal } = useMessage(); /** * @description: 数据处理,方便区分多种处理方式 */ -const transform: AxiosTransform = { +export const transform: AxiosTransform = { /** * @description: 处理请求数据。如果数据不是预期格式,可直接抛出错误 */ transformRequestHook: (res: AxiosResponse, options: RequestOptions) => { + //console.log('最开始的 res =>',res); + const { t } = useI18n(); const { isTransformResponse, isReturnNativeResponse } = options; // 是否返回原生响应头 比如:需要获取响应头时使用该属性 @@ -191,6 +193,7 @@ const transform: AxiosTransform = { * @description: 响应错误处理 */ responseInterceptorsCatch: (error: any) => { + //console.log('报错了!',error); const { t } = useI18n(); const errorLogStore = useErrorLogStoreWithOut(); errorLogStore.addAjaxErrorInfo(error); @@ -202,12 +205,18 @@ const transform: AxiosTransform = { const err: string = error?.toString?.() ?? ''; let errMessage = ''; + //console.log('报错了!',response, code, message, config,error,config?.url); + try { + if (code === 'ECONNABORTED' && message.indexOf('timeout') !== -1) { errMessage = t('sys.api.apiTimeoutMessage'); } if (err?.includes('Network Error')) { errMessage = t('sys.api.networkExceptionMsg'); + //errMessage = '请刷新'; + //刷新页面 + window.location.href = config?.url || window.location.href; } if (errMessage) { diff --git a/src/views/kc/config/KcExportConfigTpkwcqkjzglx.data.ts b/src/views/kc/config/KcExportConfigTpkwcqkjzglx.data.ts index 5c25060..3599765 100644 --- a/src/views/kc/config/KcExportConfigTpkwcqkjzglx.data.ts +++ b/src/views/kc/config/KcExportConfigTpkwcqkjzglx.data.ts @@ -44,6 +44,11 @@ export const columns: BasicColumn[] = [ align: "center", dataIndex: 'ytkcs' }, + { + title: '任教专业', + align: "center", + dataIndex: 'rjzy' + }, // { // title: '每学期应听课次数', // align: "center", diff --git a/src/views/kc/config/KcExportConfigTpkwcqkjzglxPzList.vue b/src/views/kc/config/KcExportConfigTpkwcqkjzglxPzList.vue index 2785591..6e03847 100644 --- a/src/views/kc/config/KcExportConfigTpkwcqkjzglxPzList.vue +++ b/src/views/kc/config/KcExportConfigTpkwcqkjzglxPzList.vue @@ -38,6 +38,12 @@ + + + + + + diff --git a/src/views/kc/config/components/KcExportConfigTpkwcqkjzglxForm.vue b/src/views/kc/config/components/KcExportConfigTpkwcqkjzglxForm.vue index 16510f7..7c304dc 100644 --- a/src/views/kc/config/components/KcExportConfigTpkwcqkjzglxForm.vue +++ b/src/views/kc/config/components/KcExportConfigTpkwcqkjzglxForm.vue @@ -37,6 +37,11 @@ + + + + + @@ -70,6 +75,7 @@ xm: '', zt: '', ytkcs: '', + rjzy: '', }); const { createMessage } = useMessage(); const labelCol = ref({ xs: { span: 24 }, sm: { span: 5 } }); diff --git a/src/views/site/common/header.vue b/src/views/site/common/header.vue index f62b73e..0e0bddf 100644 --- a/src/views/site/common/header.vue +++ b/src/views/site/common/header.vue @@ -65,6 +65,7 @@ + {{ projectName }} {{getSysConfig().flag1}}({{getSysConfig().bxqkssj}}至{{getSysConfig().bxqjssj}}) 本学期听课要求:{{tkyqcs}};已完成:{{tkyqywc}}次 @@ -101,7 +102,10 @@ import { useUserStore } from '/@/store/modules/user'; import YjfkModal from '/@/views/site/yjfk/YjfkModal.vue'; import { getUserSf,getSysConfig } from '/@/views/site/utils/index'; -import { defHttp } from '/@/utils/http/axios'; + import { defHttp, transform } from '/@/utils/http/axios'; + + + import { VAxios } from '/@/utils/http/axios/Axios'; const tkyqcs = ref('未配置'); const tkyqywc = ref('0'); @@ -161,6 +165,16 @@ function toIndex(){ YjfkModalTab.value.add() } + const axios = new VAxios({ + transform: { + transformRequestHook: transform.transformRequestHook, + responseInterceptorsCatch: transform.responseInterceptorsCatch, + } + }); + function testKuayu() { + axios.get({ url: 'https://webvpn.nenu.edu.cn/vpn_key/update?origin=https%3A%2F%2Fzxkccx.webvpn.nenu.edu.cn%2Fjeecg-boot%2FkcJieci%2FkcJieci%2FgetIndexJcList%3F_t%3D1696816325815&reason=site+zxkccx.webvpn.nenu.edu.cn+not+found' }); + } +