本次提交实现了与 iOS 对齐的跨端消息引用协议,新增 QuoteBar 组件用于渲染引用消息栏,重构发送逻辑支持文本和媒体消息的引用功能。主要改动包括: - 新增 reply.ts 处理引用数据的构建和解析 - 新增 QuoteBar 组件渲染引用消息预览 - 重构发送逻辑,将引用快照放入消息头部而非内容 - 调整代理配置指向本地开发环境 - 优化消息操作权限,支持名片和媒体消息引用
35 lines
1.4 KiB
TypeScript
35 lines
1.4 KiB
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
import tailwindcss from '@tailwindcss/vite'
|
|
import react from '@vitejs/plugin-react'
|
|
import { defineConfig } from 'vite'
|
|
|
|
import pkg from './package.json' with { type: 'json' }
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [react(), tailwindcss()],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
},
|
|
},
|
|
define: {
|
|
__APP_VERSION__: JSON.stringify(pkg.version),
|
|
},
|
|
server: {
|
|
port: process.env.PORT ? Number(process.env.PORT) : 8094,
|
|
// Same-origin dev proxy for the REST layer only -- avoids CORS entirely (the browser only ever
|
|
// sees http://localhost:8094) so a resolved tenant's *relative* endpoints ("/v1/im", "/v0/file")
|
|
// work unmodified in local dev, same idea as the old app's hand-rolled dev-proxy-server.js, just
|
|
// using Vite's built-in proxy instead of a bespoke Node server. The Tinode WS connection itself
|
|
// does NOT need this: WebSocket isn't subject to the fetch() same-origin policy, so it connects
|
|
// straight to the tenant's real host regardless (confirmed working this way throughout the old
|
|
// app's development too).
|
|
proxy: {
|
|
'/v1/im': { target: 'http://127.0.0.1:6060', changeOrigin: true, secure: false },
|
|
'/v0/file': { target: 'http://127.0.0.1:6060', changeOrigin: true, secure: false },
|
|
},
|
|
},
|
|
})
|