From b85b89a56967258f347f78e5cad73bc535a7d3d7 Mon Sep 17 00:00:00 2001 From: lt Date: Mon, 27 Apr 2026 16:45:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E6=B3=A8=E5=86=8C=20ElementPl?= =?UTF-8?q?us=20=E6=8F=92=E4=BB=B6=EF=BC=8C=E4=BF=AE=E5=A4=8D=20async=20?= =?UTF-8?q?=E8=AF=AD=E6=B3=95=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 统一在 createApp 后调用 app.use(ElementPlus) - 为 handlePublish 添加 async 关键字 - 修正静态资源路径引用 - 解决登录页空白、按钮不可用问题 版本: v1.0.1 --- .gitignore | 1 + data/yzr.db | Bin 90112 -> 90112 bytes platform/frontend/index.html | 4 +++- platform/frontend/logs.html | 4 +++- platform/frontend/topics.html | 6 ++++-- platform/frontend/users.html | 4 +++- 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index ceda13b..d460aab 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,4 @@ automation/data/published/* !automation/data/published/.gitkeep content/published/* !content/published/.gitkeep +data/*.db diff --git a/data/yzr.db b/data/yzr.db index 70f312c3c3d9090d17fd9c3a8303dc9ae70433a2..f58c8873ae250dc76ff3b603faa03d54c834b16d 100644 GIT binary patch delta 384 zcmZoTz}j$tb%Hcw=0q81#>|ZgOa3z(^4^%r&gd<`dxO7^zm`9TKak&nU!V8U);Pv8 zUTIEdamJkd^vpa%0cKSQD?TkTGbc60VEboYMnNWKL%uuH*##KmS@<6D-PtUtP{cR+ zgFOp}p&=_XBcp-A_7`%DGK@e~U#7DwFov@5{p9GXtX`h%ngxPmhs} zQOJ;=hk^e*|0({X{JZ(L@o(f8oGxO(7{tWS12lILNCPKKgP1+zI{{`X){^P$0YEV} zHP({Nf&vz-e2w~sJPe%T;tUM>@{Qrs1!EXhWqk9iGIMeg^-c8*6f`0X4XqV?GV@9+ z6e=vt;-@FZGI|;r85o)A8kp!BnJXArSQ(pG8CdFB8X6dz7&Rsu@GvmQt1>XSsyDGa zCg$bmRp#cG7EgcZ#wfv8TAW%GpO;?}pO#;mmoi-^mT`uFg_WVPm9eRwnSrIbnR&4O P^u%yRukB&sjH@^RXAopB delta 168 zcmV;Z09XHjzy*N71&|v7XOSF30cWvbr2hji4fB-;0ZSAQjt_kgY!6WnKo2hupAQ8N z`3~)~5fF_HxAP4F5ds4*4(OK$5CLDa5g>vNlkh(Tx9lDP7y$z>4*r)1AOTgkU?2gM z4v|m}xBe~x1_2N+4;BCq&kxEE#Sgm=whytF7BB%)vk@S$4!0IR0qzh37zYZM2T%bq Wvk?%|1_Dzrmtj`{O1D;50jdZA@iG4Z diff --git a/platform/frontend/index.html b/platform/frontend/index.html index b52084c..7e3bc3d 100644 --- a/platform/frontend/index.html +++ b/platform/frontend/index.html @@ -162,7 +162,9 @@ } } }; - Vue.createApp(App).mount('#app'); + const app = Vue.createApp(App); + app.use(ElementPlus); + app.mount('#app'); diff --git a/platform/frontend/logs.html b/platform/frontend/logs.html index d74aab4..76323d3 100644 --- a/platform/frontend/logs.html +++ b/platform/frontend/logs.html @@ -107,7 +107,9 @@ .catch(() => { localStorage.removeItem('authToken'); window.location.href = '/'; }); } }; - Vue.createApp(LogsApp).mount('#app'); + const app = Vue.createApp(LogsApp); + app.use(ElementPlus); + app.mount('#app'); \ No newline at end of file diff --git a/platform/frontend/topics.html b/platform/frontend/topics.html index 3620870..369b88c 100644 --- a/platform/frontend/topics.html +++ b/platform/frontend/topics.html @@ -164,7 +164,7 @@ await this.fetchTopics(); } else { this.$message.info('仅待审查选题可优化'); } }, - handlePublish(topic) { this.$message.success('发布:' + topic.title); await this.fetchTopics(); }, + async handlePublish(topic) { this.$message.success('发布:' + topic.title); await this.fetchTopics(); }, deleteTopic(id) { this.$confirm('确定删除?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }) .then(async () => { this.$message.success('删除成功'); await this.fetchTopics(); }).catch(() => {}); @@ -182,7 +182,9 @@ .catch(() => { localStorage.removeItem('authToken'); window.location.href = '/'; }); } }; - Vue.createApp(TopicsApp).mount('#app'); + const app = Vue.createApp(TopicsApp); + app.use(ElementPlus); + app.mount('#app'); \ No newline at end of file diff --git a/platform/frontend/users.html b/platform/frontend/users.html index 52f82e4..eecff8d 100644 --- a/platform/frontend/users.html +++ b/platform/frontend/users.html @@ -127,7 +127,9 @@ .catch(() => { localStorage.removeItem('authToken'); window.location.href = '/'; }); } }; - Vue.createApp(UsersApp).mount('#app'); + const app = Vue.createApp(UsersApp); + app.use(ElementPlus); + app.mount('#app'); \ No newline at end of file