Compare commits

..

No commits in common. "1df9ee3cf29763fe8b0bb6cf4a8154edd716436d" and "7b4fb72cdca9ac3666f50ccb8c50768d611b6075" have entirely different histories.

6 changed files with 16 additions and 21 deletions

View File

@ -94,7 +94,7 @@ async def create_share_handler(data: dict):
return {
"id": share["id"],
"shareUrl": f"/chat-ui/share/{share['id']}",
"shareUrl": f"/#/share/{share['id']}",
"expiresAt": share["expiresAt"],
}
@ -114,7 +114,7 @@ async def create_share_handler(data: dict):
conv_snapshot = {
"id": conv["id"],
"title": conv["title"],
"messages": conv.get("messages", []),
"messages": conv.get("messages", [])[:100], # 限制消息数量
"createdAt": conv["createdAt"],
"updatedAt": conv["updatedAt"],
}
@ -139,7 +139,7 @@ async def create_share_handler(data: dict):
# 返回分享信息
return {
"id": share["id"],
"shareUrl": f"/chat-ui/share/{share['id']}",
"shareUrl": f"/#/share/{share['id']}",
"expiresAt": share["expiresAt"],
}
@ -227,4 +227,4 @@ async def verify_share_handler(share_id: str, data: dict):
"viewCount": view_count,
"hasPassword": bool(share["passwordHash"]),
},
}
}

View File

@ -24,7 +24,7 @@ describe('分享 API 测试', () => {
it('应该成功创建分享', async () => {
const mockResponse: ShareCreateResponse = {
id: 'share-123',
shareUrl: 'https://example.com/chat-ui/share/share-123',
shareUrl: 'https://example.com/#/share/share-123',
expiresAt: Date.now() + 7 * 24 * 60 * 60 * 1000,
}
@ -147,4 +147,4 @@ describe('分享 API 测试', () => {
expect(result.share).toBeUndefined()
})
})
})
})

View File

@ -175,7 +175,6 @@
message.role === 'assistant' &&
!message.isStreaming &&
!message.isError &&
!readonly &&
!isMessageSelectMode
"
:content="message.content.text || ''"
@ -224,14 +223,12 @@ const props = withDefaults(
isNew?: boolean;
isMessageSelectMode?: boolean;
isSelected?: boolean;
readonly?: boolean;
}>(),
{
showTimestamp: true,
compact: false,
isMessageSelectMode: false,
isSelected: false,
readonly: false,
},
);
const { copy } = useClipboard({ legacy: true });
@ -491,7 +488,7 @@ setCustomComponents("playground-demo", {
// markstream-vue
.text-content {
:deep(p) {
:deep(p) {
margin: 0 0 12px;
&:last-child {
@ -667,16 +664,15 @@ setCustomComponents("playground-demo", {
}
}
.images-flex {
display: inline-flex;
flex-wrap: wrap;
gap: 7px;
.images-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
gap: 8px;
margin-top: 12px;
}
.image-item {
position: relative;
width: 130px;
aspect-ratio: 1;
border-radius: 12px;
overflow: hidden;

View File

@ -191,8 +191,8 @@ async function handleCreateShare() {
//
handleClose()
// 使
const shareUrl = new URL(result.shareUrl, window.location.origin).toString()
// URL
const shareUrl = `${window.location.origin}/chat-ui/share/${result.id}`
//
settingsStore.setShareResult({
@ -576,4 +576,4 @@ watch(show, (newVal: boolean) => {
transform: scale(0.95);
}
}
</style>
</style>

View File

@ -2,7 +2,7 @@ import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '@/views/HomeView.vue'
const router = createRouter({
history: createWebHistory('/'),
history: createWebHistory('/chat-ui/'),
routes: [
{
path: '/',

View File

@ -100,7 +100,6 @@
:key="message.id"
:message="message"
:show-timestamp="true"
:readonly="true"
/>
</template>
</div>
@ -563,4 +562,4 @@ onMounted(() => {
padding: 20px 0;
overflow-y: auto;
}
</style>
</style>