refactor: 项目规范

This commit is contained in:
2025-06-22 10:06:05 +08:00
parent 3ea5a17caa
commit 8de8fbfc26
43 changed files with 143 additions and 119 deletions
+4 -4
View File
@@ -1,8 +1,8 @@
import axios from 'axios'
import router from '@/router/routers'
import {Notification} from 'element-ui'
import { Notification } from 'element-ui'
import store from '../store'
import {getToken} from '@/utils/auth'
import { getToken } from '@/utils/auth'
import Config from '@/settings'
import Cookies from 'js-cookie'
@@ -37,7 +37,7 @@ service.interceptors.response.use(
if (error.response.data instanceof Blob && error.response.data.type.toLowerCase().indexOf('json') !== -1) {
const reader = new FileReader()
reader.readAsText(error.response.data, 'utf-8')
reader.onload = function (e) {
reader.onload = function(e) {
const errorMsg = JSON.parse(reader.result).message
Notification.error({
title: errorMsg,
@@ -66,7 +66,7 @@ service.interceptors.response.use(
location.reload()
})
} else if (code === 403) {
router.push({path: '/401'})
router.push({ path: '/401' })
} else {
const errorMsg = error.response.data.message
if (errorMsg !== undefined) {