CN-240 feat: 实体详情

This commit is contained in:
chenjinsong
2022-01-03 22:46:22 +08:00
parent e37e967b5d
commit 6d73abf18f
19 changed files with 481 additions and 126 deletions

View File

@@ -2,7 +2,7 @@ import axios from 'axios'
import { storageKey } from '@/utils/constants'
axios.interceptors.request.use(config => {
const token = sessionStorage.getItem('cn-token')
const token = localStorage.getItem('cn-token')
if (token) {
config.headers.Authorization = token // 请求头token
}
@@ -41,11 +41,11 @@ axios.interceptors.request.use(
axios.interceptors.response.use(
response => {
if (licenceErrorCode.indexOf(response.data.code) !== -1) {
sessionStorage.removeItem(storageKey.token)
localStorage.removeItem(storageKey.token)
window.location.href = '/'
} else if (response.status === 200) {
if (accountErrorCode.indexOf(response.data.code) !== -1) {
sessionStorage.removeItem(storageKey.token)
localStorage.removeItem(storageKey.token)
window.location.href = '/'
}
}