2026-09-11 22:46:31 +08:00
|
|
|
import { createApp } from 'vue';
|
|
|
|
|
import { createPinia } from 'pinia';
|
|
|
|
|
import ElementPlus from 'element-plus';
|
|
|
|
|
import zhCn from 'element-plus/es/locale/lang/zh-cn';
|
|
|
|
|
import * as ElementPlusIconsVue from '@element-plus/icons-vue';
|
|
|
|
|
import 'element-plus/dist/index.css';
|
2026-10-02 11:18:47 +08:00
|
|
|
// 深色主题:html.dark 下的 --el-* 变量(品牌覆盖在 styles/index.css 的 html.dark 块)
|
|
|
|
|
import 'element-plus/theme-chalk/dark/css-vars.css';
|
2026-09-11 22:46:31 +08:00
|
|
|
|
|
|
|
|
import App from './App.vue';
|
|
|
|
|
import router from './router/index.js';
|
2026-10-02 00:25:10 +08:00
|
|
|
import { registerSmokeHooks, setSmokeTeacherCredentials } from './cache/self-test.js';
|
2026-09-11 22:46:31 +08:00
|
|
|
import './styles/index.css';
|
|
|
|
|
|
|
|
|
|
const app = createApp(App);
|
|
|
|
|
|
|
|
|
|
for (const [name, component] of Object.entries(ElementPlusIconsVue)) {
|
|
|
|
|
app.component(name, component);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
app.use(createPinia());
|
|
|
|
|
app.use(router);
|
|
|
|
|
app.use(ElementPlus, { locale: zhCn });
|
|
|
|
|
|
2026-10-02 00:25:10 +08:00
|
|
|
// 冒烟验证模式:把缓存自检钩子暴露给主进程调用(正常运行时不存在)。
|
|
|
|
|
// 教师凭据由 preload 从环境变量透传(**不写在代码里**:渲染产物会进 app.asar 发给学生机)。
|
2026-09-11 22:46:31 +08:00
|
|
|
if (window.desktop?.smokeTest) {
|
2026-10-02 00:25:10 +08:00
|
|
|
setSmokeTeacherCredentials({
|
|
|
|
|
username: window.desktop.smokeCredentials?.username ?? '',
|
|
|
|
|
password: window.desktop.smokeCredentials?.password ?? '',
|
|
|
|
|
});
|
2026-09-11 22:46:31 +08:00
|
|
|
registerSmokeHooks();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await router.isReady();
|
|
|
|
|
app.mount('#app');
|