2
This commit is contained in:
@@ -5,6 +5,17 @@ import './styles/theme.scss'
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
|
||||
// 自动注入管理员身份(仅当本地未设置时)
|
||||
try {
|
||||
const k = 'USER_ID'
|
||||
const existed = localStorage.getItem(k)
|
||||
if (!existed || !existed.trim()) {
|
||||
// 可被环境变量覆盖:VITE_ADMIN_USER_ID
|
||||
const envUid = String((import.meta as any).env?.VITE_ADMIN_USER_ID || '')
|
||||
localStorage.setItem(k, envUid || '1')
|
||||
}
|
||||
} catch {}
|
||||
|
||||
const app = createApp(App)
|
||||
app.use(ElementPlus)
|
||||
app.use(router)
|
||||
|
||||
Reference in New Issue
Block a user