| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- import './utils/patch-el-select-filterable'
- import App from './App.vue'
- import { createApp } from 'vue'
- import { ElTable } from 'element-plus'
- import EmptyAwareElTag from './utils/patch-el-tag-empty'
- ElTable.props.border = { type: Boolean, default: true }
- import { initStore } from './store' // Store
- import { initRouter } from './router' // Router
- import language from './locales' // 国际化
- import '@styles/core/tailwind.css' // tailwind
- import '@styles/index.scss' // 样式
- import '@utils/sys/console.ts' // 控制台输出内容
- import { setupGlobDirectives } from './directives'
- import { setupErrorHandle } from './utils/sys/error-handle'
- function maskSecret(value?: string) {
- if (!value) return '(empty)'
- if (value.length <= 6) return '*'.repeat(value.length)
- return `${value.slice(0, 3)}***${value.slice(-3)}`
- }
- function logApiCryptoBootInfo() {
- const {
- VITE_API_ENCRYPT_ENABLED,
- VITE_API_ENCRYPT_FAIL_OPEN,
- VITE_API_ENCRYPT_FIXED_SECRET,
- VITE_API_ENCRYPT_EXCLUDE_PATHS
- } = import.meta.env
- const excludeCount = String(VITE_API_ENCRYPT_EXCLUDE_PATHS || '')
- .split(',')
- .map((item) => item.trim())
- .filter(Boolean).length
- console.info(
- '[API_CRYPTO_BOOT] enabled=%s failOpen=%s fixedSecret=%s excludeCount=%s mode=%s',
- String(VITE_API_ENCRYPT_ENABLED || 'false'),
- String(VITE_API_ENCRYPT_FAIL_OPEN || 'true'),
- maskSecret(String(VITE_API_ENCRYPT_FIXED_SECRET || '')),
- excludeCount,
- import.meta.env.MODE
- )
- }
- document.addEventListener(
- 'touchstart',
- function () {},
- { passive: false }
- )
- logApiCryptoBootInfo()
- const app = createApp(App)
- app.component('ElTag', EmptyAwareElTag)
- initStore(app)
- initRouter(app)
- setupGlobDirectives(app)
- setupErrorHandle(app)
- app.use(language)
- app.mount('#app')
|