import { createApp } from 'vue' import Cookies from 'js-cookie' import ElementPlus from 'element-plus' import locale from 'element-plus/lib/locale/lang/zh-cn' // 中文语言 import '@/assets/styles/index.scss' // global css import App from './App' import store from './store' import router from './router' import directive from './directive' // directive // 注册指令 import plugins from './plugins' // plugins import { download } from '@/utils/request' // svg图标 import 'virtual:svg-icons-register' import SvgIcon from '@/components/SvgIcon' import elementIcons from '@/components/SvgIcon/svgicon' import './permission' // permission control import { useDict } from '@/utils/dict' import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi' // 分页组件 import Pagination from '@/components/Pagination' // 自定义表格工具组件 import RightToolbar from '@/components/RightToolbar' // 文件上传组件 import FileUpload from "@/components/FileUpload" // 图片上传组件 import ImageUpload from "@/components/ImageUpload" // 图片预览组件 import ImagePreview from "@/components/ImagePreview" // 自定义树选择组件 import TreeSelect from '@/components/TreeSelect' // 字典标签组件 import DictTag from '@/components/DictTag' //文件预览 import FilePreview from '@/components/FilePreview' //jquery import $ from 'jquery' //字体 import "./assets/css/font.css" import 'animate.css'; const app = createApp(App) import {sm2} from 'sm-crypto' // const { publicKey, privateKey } = sm2.generateKeyPairHex() // console.log(privateKey,'私') // const privateKey = 'MIGTAgEAMBMGByqGSM49AgEGCCqBHM9VAYItBHkwdwIBAQQgwC9MZ/d8ns+P1bpVkO1t7ywuIaGtvqgupK+WTFueVAagCgYIKoEcz1UBgi2hRANCAAT/vI0JAjsFlW/eBjm+xrCPulr2IXwqVUbiRASxEN5hNnqBOt0k0dMQPLfJUb1Rj5dleW8OTmVyuUW6Dh8aQA+h' // const publicKey = '04MFkwEwYHKoZIzj0CAQYIKoEcz1UBgi0DQgAE/7yNCQI7BZVv3gY5vsawj7pa9iF8KlVG4kQEsRDeYTZ6gTrdJNHTEDy3yVG9UY+XZXlvDk5lcrlFug4fGkAPoQ==' const privateKey = '1d04b0f2c241c3ba021c2dde8cfcf2349cfa83a74b70a8e99b056541b108573e' const publicKey = '049232d0423c2eb7c345cddec693852f89b05eda6cffbbe3ea586c814d73af541411b92ea2ab0be404c39f8621bf1daa1637c5b7546e20dcb1094859ee7f372c0a' const cipherMode = 1 // 1 - C1C3C2,0 - C1C2C3,默认为1 let encryptData = sm2.doEncrypt('我是一段测试aaaa', publicKey, cipherMode) // 加密结果 let decryptData = sm2.doDecrypt(encryptData, privateKey,1) // 解密结果 let decryptData1 = sm2.doDecrypt("6E67ADE93273474CA855727114DEEB79C304FE3E4CCF9CA9B47B1C170EFBA58B096D92E6BED2B97CF69944005654DF9ED0DD470D9EB05A34A94E4A15A9E422CF8405ED30EF8A104EE8DBD6F02FDBC780E14A639DDF7F954D8A73F3A317BC4E35E6EC8FEC0277598DBD6D536359B0DD9124B60CB6E1F472949A05C5D7CF50C2960E2D8331569B624D29D2E2D516CA77E8D31DCDE8B2085605CB096DF72195B0C407183D689E9ECF52A2F16A850B786A3E6973CA861B6E93169592497370DCC6AFBCD4976914750AB6C7F45FDC7587B997E71F92F2B01A8144C3B33F3CAF39360AA4F7485357B8E64F9C3AA1962CE55F75A345B2ED8A2FC4F340B38279790A59E17D22F5112411F4B2D4",privateKey,1) // 解密结果 // 全局方法挂载 · app.config.globalProperties.useDict = useDict app.config.globalProperties.download = download app.config.globalProperties.parseTime = parseTime app.config.globalProperties.resetForm = resetForm app.config.globalProperties.handleTree = handleTree app.config.globalProperties.addDateRange = addDateRange app.config.globalProperties.selectDictLabel = selectDictLabel app.config.globalProperties.selectDictLabels = selectDictLabels // 全局组件挂载 app.component('DictTag', DictTag) app.component('Pagination', Pagination) app.component('TreeSelect', TreeSelect) app.component('FileUpload', FileUpload) app.component('FilePreview', FilePreview) app.component('ImageUpload', ImageUpload) app.component('ImagePreview', ImagePreview) app.component('RightToolbar', RightToolbar) app.use(router) app.use(store) app.use(plugins) app.use(elementIcons) app.component('svg-icon', SvgIcon) directive(app) // 使用element-plus 并且设置全局的大小 app.use(ElementPlus, { locale: locale, // 支持 large、default、small size: Cookies.get('size') || 'default' }) app.mount('#app')