字体与901状态码更改

main
ysn 3 days ago
parent 3be9ff6cf0
commit 28e7bd285c
  1. 9
      src/assets/styles/index.scss
  2. 24
      src/utils/request.js

@ -10,7 +10,12 @@ body {
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility; text-rendering: optimizeLegibility;
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; font-family: "Source Han Sans CN", "思源黑体", sans-serif;
}
/* 覆盖所有 Element UI 组件字体 */
[class^="el-"] {
font-family: "Source Han Sans CN", "思源黑体", sans-serif !important;
} }
label { label {
@ -104,7 +109,7 @@ aside {
display: block; display: block;
line-height: 32px; line-height: 32px;
font-size: 16px; font-size: 16px;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; font-family: "Source Han Sans SC", "Noto Sans SC", sans-serif;
color: #2c3e50; color: #2c3e50;
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;

@ -82,15 +82,27 @@ service.interceptors.response.use(res => {
if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') { if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') {
return res.data return res.data
} }
if (code === 401) { if (code === 401 || code == 910) {
// 防止重复弹窗,使用延时重置锁,兼容并发请求
if (!isRelogin.show) { if (!isRelogin.show) {
isRelogin.show = true isRelogin.show = true
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { MessageBox.confirm(
isRelogin.show = false '登录状态已过期,您可以继续留在该页面,或者重新登录',
store.dispatch('LogOut').then(() => { '系统提示',
location.href = '/index' {
}) confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning'
}
).then(() => {
// 退出登录并跳转
return store.dispatch('LogOut')
}).then(() => {
location.href = '/index'
}).catch(() => { }).catch(() => {
// 捕获异常,保证锁一定释放
}).finally(() => {
// 无论点确定/取消/报错,最终都解锁
isRelogin.show = false isRelogin.show = false
}) })
} }

Loading…
Cancel
Save