import { urls } from 'common/api'
import { GLOBAL_INFO_KEY } from 'common/storage'
import { encryptByDES, decryptByDES } from 'util/des'

/**
 * 空GUID
 */
export const EMPTY_ID = '00000000-0000-0000-0000-000000000000'

/**
 * 文件预览地址
 */
export const PERVIEW_URL = process.env.REACT_APP_BASE_URL + urls.sysFileInfoPreview[0]


/**
 * 全局信息设置
 */
export const setGlobal = (info) => {
    //app.$set(app.global, 'info', info)
    window.sessionStorage.setItem(GLOBAL_INFO_KEY, encryptByDES(JSON.stringify(info)))
}
export const removeGlobal = () => {
    //app.$set(app.global, 'info', undefined)
    window.sessionStorage.removeItem(GLOBAL_INFO_KEY)
}
export const getGlobal = () => {
    return JSON.parse(decryptByDES(window.sessionStorage.getItem(GLOBAL_INFO_KEY)))
}

/**
 * RSA公钥
 */
export const RSA_PUBLIC_KEY = '-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC273zAyijb3uX6O66VThrdfHtzZJn3d/SBM8qiETS7PijyNY3zNecAB+F/owxOWSB/6ojBo5Eu0FCiENxfpenTZB7sKrYu6NVH5gkfHLa6jz4pNzlGP93Q6RON4KjMZolAfRevBQ7vD6sOfJfMDnYi8xk+dRXcqc6PWY8fQiGs5QIDAQAB-----END PUBLIC KEY-----'

/**
 * 城市名称
 */
export const CITY = '黄石市'

/**
 * 
 */
export const AMAP_WEBAPI_KEY = 'ca01719fe09757131a1249c273619a17'

/**
 * 响应式响应宽度
 */
export const SIDER_BREAK_POINT = 1366