mirror of
https://github.com/fastapiadmin/FastapiAdmin.git
synced 2026-10-15 13:25:51 +00:00
refactor(frontend): 重构前端样式体系,统一资源路径与代码规范
1. 重构SCSS样式结构,将原有分散的样式文件整合到custom目录下,统一使用@use替代@import 2. 删除冗余的全局样式文件,将样式逻辑内联到对应组件或集中到core目录 3. 新增DOMPurify依赖,对富文本内容添加XSS防护 4. 修复metrics端点暴露的兼容性问题,优化启动banner样式 5. 移除无用的权限校验代码,重构工作流组件路径与命名 6. 优化样式混合宏与响应式布局,修复部分组件样式冲突
This commit is contained in:
@@ -25,9 +25,7 @@
|
||||
留言讨论
|
||||
</ElButton>
|
||||
<ElButton @click="visible = false">关闭</ElButton>
|
||||
<ElButton v-if="articleId != null" v-auth="'edit'" type="primary" @click="onEditClick">
|
||||
编辑
|
||||
</ElButton>
|
||||
<ElButton v-if="articleId != null" type="primary" @click="onEditClick"> 编辑 </ElButton>
|
||||
</div>
|
||||
</template>
|
||||
</ElDrawer>
|
||||
@@ -37,6 +35,7 @@
|
||||
import "@styles/core/md.scss";
|
||||
import "@styles/custom/one-dark-pro.scss";
|
||||
import axios from "axios";
|
||||
import DOMPurify from "dompurify";
|
||||
|
||||
defineOptions({ name: "ArticleDetailDrawer" });
|
||||
|
||||
@@ -91,7 +90,7 @@ const fetchDetail = async () => {
|
||||
|
||||
if (data.code === 200) {
|
||||
articleTitle.value = data.data.title;
|
||||
articleHtml.value = data.data.html_content;
|
||||
articleHtml.value = DOMPurify.sanitize(data.data.html_content);
|
||||
} else {
|
||||
error.value = "文章加载失败";
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<FaSvgIcon icon="ri:message-3-line" class="mr-1" />
|
||||
留言墙
|
||||
</ElButton>
|
||||
<ElButton type="primary" @click="toAddArticle" v-auth="'add'">新增文章</ElButton>
|
||||
<ElButton type="primary" @click="toAddArticle">新增文章</ElButton>
|
||||
</ElCol>
|
||||
</ElRow>
|
||||
|
||||
@@ -65,7 +65,6 @@
|
||||
</div>
|
||||
<ElButton
|
||||
class="opacity-0 group-hover:opacity-100"
|
||||
v-auth="'edit'"
|
||||
size="small"
|
||||
@click.stop="toEdit(item)"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user