backend增加租户简称登录

This commit is contained in:
2026-07-17 11:00:33 +08:00
parent dcf06db11b
commit 2232ef6f3c
14 changed files with 916 additions and 746 deletions
@@ -15,6 +15,16 @@
</div>
</div>
<div class="editor-toolbar">
<el-switch
v-model="pinned"
inline-prompt
active-text="置顶"
inactive-text="置顶"
:disabled="loading"
/>
</div>
<div class="editor-body">
<UmoEditor v-model="noteContent" />
</div>
@@ -38,6 +48,7 @@ const emit = defineEmits(['save-success', 'create-success']);
const noteTitle = ref('');
const noteContent = ref('');
const pinned = ref(false);
const loading = ref(false);
const isNew = ref(false);
@@ -47,6 +58,7 @@ const loadNote = async () => {
isNew.value = true;
noteTitle.value = '新建笔记';
noteContent.value = '';
pinned.value = false;
return;
}
@@ -58,6 +70,7 @@ const loadNote = async () => {
if (response.code === 200) {
noteTitle.value = response.data.title || '无标题';
noteContent.value = response.data.content || '';
pinned.value = Number(response.data.pinned) === 1;
} else {
ElMessage.error('加载笔记失败');
}
@@ -84,6 +97,7 @@ const handleSave = async () => {
const response = await createNotebook({
title: noteTitle.value,
content: noteContent.value,
pinned: pinned.value ? 1 : 0,
});
if (response.code === 200) {
@@ -98,6 +112,7 @@ const handleSave = async () => {
const response = await updateNotebook(props.noteId, {
title: noteTitle.value,
content: noteContent.value,
pinned: pinned.value ? 1 : 0,
});
if (response.code === 200) {
@@ -175,6 +190,15 @@ onMounted(() => {
}
}
.editor-toolbar {
min-height: 42px;
padding: 8px 20px;
display: flex;
align-items: center;
border-bottom: 1px solid var(--el-border-color-lighter);
background: var(--el-bg-color);
}
.editor-body {
flex: 1;
padding: 20px;
@@ -28,6 +28,15 @@
>
<div class="note-item-header">
<span class="note-title">{{ note.title || '无标题' }}</span>
<el-tag
v-if="Number(note.pinned) === 1"
class="pinned-tag"
size="small"
type="warning"
effect="plain"
>
置顶
</el-tag>
<el-dropdown trigger="click" @command="(cmd) => handleNoteAction(cmd, note)">
<el-icon class="note-more"><MoreFilled /></el-icon>
<template #dropdown>
@@ -305,6 +314,7 @@ onMounted(() => {
.note-title {
flex: 1;
min-width: 0;
font-size: 14px;
font-weight: 500;
color: var(--el-text-color-primary);
@@ -313,6 +323,11 @@ onMounted(() => {
text-overflow: ellipsis;
}
.pinned-tag {
flex-shrink: 0;
margin-left: 8px;
}
.note-more {
margin-left: 8px;
color: var(--el-text-color-secondary);