CN-240 feat: 实体详情
This commit is contained in:
@@ -102,7 +102,7 @@ export async function getConfigJson () {
|
||||
|
||||
export async function getPermission () {
|
||||
const request = new Promise(resolve => {
|
||||
post(api.permission, { token: sessionStorage.getItem('cn-token') }).then(response => {
|
||||
post(api.permission, { token: localStorage.getItem('cn-token') }).then(response => {
|
||||
resolve({
|
||||
menuList: sortByOrderNum(response.data.menus),
|
||||
buttonList: response.data.buttons,
|
||||
@@ -116,7 +116,7 @@ export async function getPermission () {
|
||||
export async function getI18n () {
|
||||
const dictData = await getDictList()
|
||||
const langs = dictData.map(d => d.value).join(',')
|
||||
sessionStorage.setItem(storageKey.languages, langs)
|
||||
localStorage.setItem(storageKey.languages, langs)
|
||||
const request = new Promise(resolve => {
|
||||
get(api.i18n, { l: langs }).then(response => {
|
||||
response.data.cn = response.data.zh
|
||||
|
||||
@@ -84,34 +84,34 @@ export const entityFilterType = {
|
||||
],
|
||||
domain: [
|
||||
{
|
||||
column: 'category_group_distinct_count',
|
||||
column: 'categoryGroupDistinctCount',
|
||||
labelI18nCode: 'entities.domainDetail.categoryGroup',
|
||||
icon: 'cn-icon cn-icon-category'
|
||||
},
|
||||
{
|
||||
column: 'category_distinct_count',
|
||||
column: 'categoryDistinctCount',
|
||||
labelI18nCode: 'entities.category',
|
||||
icon: 'cn-icon cn-icon-sub-category'
|
||||
},
|
||||
{
|
||||
column: 'category_group_distinct_count',
|
||||
column: 'categoryGroupDistinctCount',
|
||||
labelI18nCode: 'entities.reputationLevel',
|
||||
icon: 'cn-icon cn-icon-credit'
|
||||
}
|
||||
],
|
||||
app: [
|
||||
{
|
||||
column: 'category_distinct_count',
|
||||
column: 'categoryDistinctCount',
|
||||
labelI18nCode: 'entities.category',
|
||||
icon: 'cn-icon cn-icon-category'
|
||||
},
|
||||
{
|
||||
column: 'subcategory_distinct_count',
|
||||
column: 'subcategoryDistinctCount',
|
||||
labelI18nCode: 'entities.subcategory',
|
||||
icon: 'cn-icon cn-icon-sub-category'
|
||||
},
|
||||
{
|
||||
column: 'risk_distinct_count',
|
||||
column: 'riskDistinctCount',
|
||||
labelI18nCode: 'entities.risk',
|
||||
icon: 'cn-icon cn-icon-risk'
|
||||
}
|
||||
|
||||
@@ -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 = '/'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user