diff --git a/.env.dev b/.env.dev index 707df190..34598f0d 100644 --- a/.env.dev +++ b/.env.dev @@ -1,7 +1,7 @@ ### # @Author: Do not edit # @Date: 2023-08-29 09:40:39 - # @LastEditTime: 2024-03-05 09:48:49 + # @LastEditTime: 2024-03-13 14:57:16 # @LastEditors: zhp # @Description: ### diff --git a/src/utils/request.js b/src/utils/request.js index 89cd58b7..5da10db2 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,10 +1,10 @@ import axios from 'axios' -import {Message, MessageBox, Notification, Loading} from 'element-ui' +import { Message, MessageBox, Notification, Loading } from 'element-ui' import store from '@/store' -import {getAccessToken, getRefreshToken, getTenantId, setToken} from '@/utils/auth' +import { getAccessToken, getRefreshToken, getTenantId, setToken } from '@/utils/auth' import errorCode from '@/utils/errorCode' -import {getPath, getTenantEnable} from "@/utils/ruoyi"; -import {refreshToken} from "@/api/login"; +import { getPath, getTenantEnable } from "@/utils/ruoyi"; +import { refreshToken } from "@/api/login"; // 需要忽略的提示。忽略后,自动 Promise.reject('error') const ignoreMsgs = [ @@ -42,7 +42,7 @@ const service = axios.create({ let loadingInstance = null function startLoading() { loadingInstance = Loading.service({ - fullscreen: false, + fullscreen: true, text: '拼命加载中...', background: 'rgba(0, 0, 0, 0.1)' }) @@ -86,7 +86,7 @@ service.interceptors.request.use(config => { for (const propName of Object.keys(config.params)) { const value = config.params[propName]; const part = encodeURIComponent(propName) + '=' - if (value !== null && typeof(value) !== "undefined") { + if (value !== null && typeof (value) !== "undefined") { if (typeof value === 'object') { for (const key of Object.keys(value)) { let params = propName + '[' + key + ']'; @@ -104,9 +104,9 @@ service.interceptors.request.use(config => { } return config }, error => { - tryHideFullScreenLoading() - console.log(error) - Promise.reject(error) + tryHideFullScreenLoading() + console.log(error) + Promise.reject(error) }) // 响应拦截器 @@ -189,23 +189,23 @@ service.interceptors.response.use(async res => { return res.data } }, error => { - tryHideFullScreenLoading() - console.log('err' + error) - let {message} = error; - if (message === "Network Error") { - message = "后端接口连接异常"; - } else if (message.includes("timeout")) { - message = "系统接口请求超时"; - } else if (message.includes("Request failed with status code")) { - message = "系统接口" + message.substr(message.length - 3) + "异常"; - } - Message({ - message: message, - type: 'error', - duration: 5 * 1000 - }) - return Promise.reject(error) + tryHideFullScreenLoading() + console.log('err' + error) + let { message } = error; + if (message === "Network Error") { + message = "后端接口连接异常"; + } else if (message.includes("timeout")) { + message = "系统接口请求超时"; + } else if (message.includes("Request failed with status code")) { + message = "系统接口" + message.substr(message.length - 3) + "异常"; } + Message({ + message: message, + type: 'error', + duration: 5 * 1000 + }) + return Promise.reject(error) +} ) export function getBaseHeader() { @@ -219,10 +219,10 @@ function handleAuthorized() { if (!isRelogin.show) { isRelogin.show = true; MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { - confirmButtonText: '重新登录', - cancelButtonText: '取消', - type: 'warning' - } + confirmButtonText: '重新登录', + cancelButtonText: '取消', + type: 'warning' + } ).then(() => { isRelogin.show = false; store.dispatch('LogOut').then(() => { diff --git a/src/views/OperationalOverview/coldBoard.vue b/src/views/OperationalOverview/coldBoard.vue index b041214c..dcea1163 100644 --- a/src/views/OperationalOverview/coldBoard.vue +++ b/src/views/OperationalOverview/coldBoard.vue @@ -1,17 +1,11 @@ - +