skyouc
2024-12-21 c635d78b479510ebe2556a420948effcd30a0731
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import { reactive, inject } from 'vue';
 
export const globalState = reactive({
    url: 'http://127.0.0.1:8081/wms',
    token: '',
    user: null,
    locale: 'zh_CN', // 默认语言
    currentHost: null,
    localeList: {//语言列表
        'zh_CN': {
            desc: '简体中文'
        },
        'zh_HK': {
            desc: '繁体中文'
        },
        'en_US': {
            desc: '英语'
        },
        'es_ES': {
            desc: '西班牙语'
        },
        'ar_EG': {
            desc: '阿拉伯语'
        },
        'de_DE': {
            desc: '德语'
        },
        'fr_FR': {
            desc: '法语'
        },
        'ru_RU': {
            desc: '俄罗斯语'
        },
        'ko_KR': {
            desc: '韩语'
        },
    },
    localeData: {}
});
 
export const logout = () => {
    globalState.token = null;
    globalState.user = null;
    globalState.currentHost = null;
    localStorage.removeItem('token')
    localStorage.removeItem('user')
}