将 web-admin 从子模块改为仓库内普通目录,便于单仓克隆与维护。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
2e9d020d50
commit
c87732fcd5
515 files changed
+74372
-1
No files matched your search
@@ -0,0 +1,74 @@
|
||||
import './utils/patch-el-select-filterable'
|
||||
import App from './App.vue'
|
||||
import { createApp } from 'vue'
|
||||
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'
|
||||
import AppConfig from './config'
|
||||
import { useUserStore } from './store/modules/user'
|
||||
|
||||
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)
|
||||
initStore(app)
|
||||
|
||||
if (AppConfig.stylePreviewOnly) {
|
||||
const u = useUserStore()
|
||||
u.setLoginStatus(true)
|
||||
u.setToken('style-preview-token', 'style-preview-refresh')
|
||||
u.setUserInfo({
|
||||
id: '0',
|
||||
username: 'style-preview',
|
||||
realName: '样式预览',
|
||||
role: 'super_admin',
|
||||
phone: '',
|
||||
regionId: '',
|
||||
regionName: '',
|
||||
isActive: true
|
||||
} as Api.Auth.UserInfo)
|
||||
}
|
||||
|
||||
initRouter(app)
|
||||
setupGlobDirectives(app)
|
||||
setupErrorHandle(app)
|
||||
|
||||
app.use(language)
|
||||
app.mount('#app')
|
||||
Reference in new issue
Block a user