fix(build): 修复 v0.5.0-beta 前端编译错误
跑 npm run build 验收时发现 2 个前端项目编译失败(vue-tsc 报错),修复 4 处:
frontend-h5:
- src/components/chat/InputBox.vue:185 多余右括号
computed(() => inputText.value.length)) -> computed(() => inputText.value.length)
- src/components/chat/MessageList.vue:134 pollMessages 调用签名错
pollMessages(convId, afterMessageId) -> pollMessages(afterMessageId)
(api/message.ts:71 签名只接 1 个 afterMessageId 参数,endpoint 走 current 不需要 convId)
frontend-agent:
- src/components/chat/InputBox.vue 4 处错
L91/234/292 conversationStore.loading 不存在(store 暴露的是 loadingMessages)
-> conversationStore.loadingMessages
L136 import onUnmounted 死引用,移除
components.d.ts: 触发 unplugin-vue-components 重新生成 6 行(新组件类型)
验证:
- frontend-h5: vue-tsc 0 错,417 modules transformed, dist/ 生成
- frontend-agent: vue-tsc 0 错,1750 modules transformed, dist/ 生成
不影响业务逻辑,纯 build fix。
This commit is contained in:
@@ -182,7 +182,7 @@ const showScreenshotEditor = ref(false)
|
||||
let screenshotCanvas: HTMLCanvasElement | null = null
|
||||
|
||||
/** 当前字符数 */
|
||||
const charCount = computed(() => inputText.value.length))
|
||||
const charCount = computed(() => inputText.value.length)
|
||||
|
||||
/** 是否可以发送消息 */
|
||||
const canSend = computed(() => {
|
||||
|
||||
@@ -131,7 +131,7 @@ async function fetchNewMessages(): Promise<void> {
|
||||
const lastMsg = messages.value[messages.value.length - 1]
|
||||
const afterMessageId = lastMsg?.message_id
|
||||
|
||||
const newMessages = await pollMessages(convId, afterMessageId)
|
||||
const newMessages = await pollMessages(afterMessageId)
|
||||
|
||||
if (newMessages && newMessages.length > 0) {
|
||||
// 添加新消息到列表
|
||||
|
||||
Reference in New Issue
Block a user