fix: 登录时将langs存入sessionStorage
This commit is contained in:
@@ -62,6 +62,7 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.chart__table-below {
|
.chart__table-below {
|
||||||
|
height: 240px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<el-dropdown>
|
<el-dropdown>
|
||||||
<div class='login-user header-menu--item'>{{username}} <i class="cn-icon cn-icon-arrow-down"></i></div>
|
<div class='login-user header-menu--item'>{{username}} <i class="cn-icon cn-icon-arrow-down"></i></div>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu #dropdown>
|
||||||
<el-dropdown-item>
|
<el-dropdown-item>
|
||||||
<div id="header-to-changepin" @click="showPinDialog">Change pin</div>
|
<div id="header-to-changepin" @click="showPinDialog">Change pin</div>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
import { get, post } from '@/utils/http'
|
import { get, post } from '@/utils/http'
|
||||||
import { sortByOrderNum } from '@/permission'
|
import { sortByOrderNum } from '@/permission'
|
||||||
|
import {storageKey} from "@/utils/constants";
|
||||||
|
|
||||||
export const api = {
|
export const api = {
|
||||||
// 系统相关
|
// 系统相关
|
||||||
@@ -121,6 +122,7 @@ export async function getPermission () {
|
|||||||
export async function getI18n () {
|
export async function getI18n () {
|
||||||
const dictData = await getDictList()
|
const dictData = await getDictList()
|
||||||
const langs = dictData.map(d => d.value).join(',')
|
const langs = dictData.map(d => d.value).join(',')
|
||||||
|
sessionStorage.setItem(storageKey.languages, langs)
|
||||||
const request = new Promise(resolve => {
|
const request = new Promise(resolve => {
|
||||||
get(api.i18n, { l: langs }).then(response => {
|
get(api.i18n, { l: langs }).then(response => {
|
||||||
response.data.cn = response.data.zh
|
response.data.cn = response.data.zh
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ export const storageKey = {
|
|||||||
iso36112Capital: 'cn-iso3611-2-capital',
|
iso36112Capital: 'cn-iso3611-2-capital',
|
||||||
iso36112WorldLow: 'cn-iso3611-2-world-low',
|
iso36112WorldLow: 'cn-iso3611-2-world-low',
|
||||||
i18n: 'cn-i18n',
|
i18n: 'cn-i18n',
|
||||||
|
languages: 'cn-languages',
|
||||||
language: 'cn-language',
|
language: 'cn-language',
|
||||||
timezone: 'cn-timezone',
|
timezone: 'cn-timezone',
|
||||||
timezoneOffset: 'cn-timezone-offset',
|
timezoneOffset: 'cn-timezone-offset',
|
||||||
|
|||||||
Reference in New Issue
Block a user