master V3.0.0
yujialong 5 months ago
parent 1174a60114
commit a9db2570fe
  1. 2
      .env
  2. 2
      .env.production
  3. 1
      src/components/Panel/index.vue
  4. 22
      src/utils/request.ts
  5. 1
      src/views/report/Index.vue

@ -2,7 +2,7 @@ VITE_APP_TITLE=金融产品设计及数字化营销沙盘
VITE_PORT=9520
# VITE_PROXY=http://192.168.31.125:8080
VITE_PUBLIC_PATH=./
VITE_BASE_API=http://192.168.31.217:9000
VITE_BASE_API=http://192.168.31.51:9000
# VITE_BASE_API=http://121.37.12.51
# VITE_BASE_API=https://www.occupationlab.com
VITE_I18N_LOCALE=zh-cn

@ -1 +1 @@
VITE_BASE_API=https://www.occupationlab.com
VITE_BASE_API=https://occupationlab.com

@ -972,6 +972,7 @@ onUnmounted(() => {
@media (max-width: 1450px) {
.panel-header {
.actions {
z-index: 10;
position: absolute;
top: 70px;
right: 30px;

@ -7,7 +7,7 @@ const service = axios.create({
baseURL: import.meta.env.VITE_BASE_API,
timeout: 10000,
});
let loaded = 0;
let logouted = 0;
service.interceptors.request.use(
(config) => {
config.headers = { ...config.headers, ...getAuthHeaders() };
@ -18,13 +18,27 @@ service.interceptors.request.use(
service.interceptors.response.use(
(res) => {
const { message, status } = res.data;
const { message, status, code, msg } = res.data;
if (status) {
if (status === 200) {
return res;
}
ElMessage.error(message);
} else if (code === 401) {
// 账号互踢
if (!logouted) {
ElMessageBox.alert(msg.includes('顶') ? '您的账号已在其他设备登录,您已被迫下线!' : '登录过期,请重新登录!', {
confirmButtonText: '重新登录',
type: 'warning',
closeOnClickModal: false,
showClose: false,
}).then(() => {
// 未登录
logout();
});
logouted = 1;
}
} else {
return res;
}
@ -37,12 +51,12 @@ service.interceptors.response.use(
},
} = e;
if (status === 401) {
loaded ||
logouted ||
ElMessageBox.alert('登录状态已过期,请重新登录', { confirmButtonText: '重新登录', type: 'warning', closeOnClickModal: false, showClose: false }).then(() => {
// 未登录
logout();
});
loaded = 1;
logouted = 1;
} else if (message) {
ElMessage.error(message);
}

@ -302,6 +302,7 @@ samp {
padding: 10px 16px;
font-size: 14px;
color: #333;
white-space: pre-wrap;
&.edit {
color: #abb3c6;
border: 1px solid #cacfdb;

Loading…
Cancel
Save