feat(room): 增加加入令牌及分块传输支持
- 后端Room和MessagePayload新增加入令牌字段,创建房间返回包含令牌 - 新增房间加入令牌验证接口,加入时需提供房间号和令牌 - 前端HomeView新增加入令牌输入框及验证逻辑 - Clipboard工具增加写入API支持及复制按钮 - FileDropZone支持选择文件夹批量上传 - FileMessage和ImageMessage新增分片进度提示及失败重试功能 - API层新增分块上传及断点续传实现,支持大文件分片上传 - 文件上传存储时计算文件sha256,响应中返回该值 - 下载接口支持断点续传,优化大文件下载体验 - README新增加入令牌安全说明及压力测试使用示例 - 资源清理与配置优化,添加磁盘使用水位阈值控制
This commit is contained in:
@@ -1,32 +1,36 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import { defineConfig, loadEnv } from 'vite';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import path from 'path';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, 'src'),
|
||||
},
|
||||
},
|
||||
// 为 sockjs-client 等依赖提供浏览器环境下的 global 替代
|
||||
define: {
|
||||
global: 'window',
|
||||
},
|
||||
server: {
|
||||
port: 5173,
|
||||
// 允许局域网内其它设备访问(如手机、其它电脑)
|
||||
host: true,
|
||||
// 开发时代理:前端用同源请求,由 Vite 转发到后端,跨设备访问时无需改 API 地址
|
||||
// xfwd: true 会把真实客户端 IP 写入 X-Forwarded-For,后端 /api/room/my-ip 才能拿到各机器的 IP
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:8080',
|
||||
changeOrigin: true,
|
||||
xfwd: true,
|
||||
},
|
||||
'/ws': { target: 'http://localhost:8080', ws: true },
|
||||
},
|
||||
},
|
||||
});
|
||||
export default defineConfig(({ mode }) => {
|
||||
const env = loadEnv(mode, process.cwd(), '');
|
||||
const backendTarget = env.VITE_DEV_BACKEND_TARGET || 'http://127.0.0.1:8080';
|
||||
|
||||
return {
|
||||
plugins: [vue()],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, 'src'),
|
||||
},
|
||||
},
|
||||
// 为 sockjs-client 等依赖提供浏览器环境下的 global 替代
|
||||
define: {
|
||||
global: 'window',
|
||||
},
|
||||
server: {
|
||||
port: 5173,
|
||||
// 允许局域网内其它设备访问(如手机、其它电脑)
|
||||
host: true,
|
||||
// 开发时代理:前端用同源请求,由 Vite 转发到后端,跨设备访问时无需改 API 地址
|
||||
// xfwd: true 会把真实客户端 IP 写入 X-Forwarded-For,后端 /api/room/my-ip 才能拿到各机器的 IP
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: backendTarget,
|
||||
changeOrigin: true,
|
||||
xfwd: true,
|
||||
},
|
||||
'/ws': { target: backendTarget, ws: true },
|
||||
},
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user