chore: 批量更新v6.5.21版本,整合多项功能修复与优化
主要变更: 1. 新增多风格音效资源与管理文档 2. 修复翻译服务空响应处理与Dio日志异常捕获 3. 完善Web端平台适配与路径获取Stub 4. 优化设备配对与文件传输功能 5. 新增角色命名常量与摇一摇检测器 6. 修复Riverpod dispose与鸿蒙导航路由 7. 新增每日通知服务与流体着色器 8. 优化备份服务与数据管理页面 9. 新增隐私设置附近设备发现选项 10. 重构诗词提供者支持历史记录 11. 完善桌面端构建配置与开发脚本 12. 清理旧版工具部署脚本
This commit is contained in:
@@ -761,10 +761,9 @@ class SnapdropServer {
|
||||
|
||||
_handlePairingCodeCreate(sender, message) {
|
||||
const payload = message.payload || message.data || {};
|
||||
const CHARS = '23456789ABCDEFGHJKMNPQRSTUVWXYZ';
|
||||
let code = '';
|
||||
for (let i = 0; i < 6; i++) {
|
||||
code += CHARS.charAt(Math.floor(Math.random() * CHARS.length));
|
||||
for (let i = 0; i < 4; i++) {
|
||||
code += Math.floor(Math.random() * 10).toString();
|
||||
}
|
||||
for (const existingCode in this._pairingCodes) {
|
||||
if (this._pairingCodes[existingCode].creatorId === sender.id) {
|
||||
@@ -791,9 +790,9 @@ class SnapdropServer {
|
||||
|
||||
_handlePairingCodeJoin(sender, message) {
|
||||
const payload = message.payload || message.data || {};
|
||||
const code = (payload.pairingCode || '').toUpperCase().trim();
|
||||
if (!code) {
|
||||
this._send(sender, { type: 'pairing-matched', success: false, error: '配对码不能为空' });
|
||||
const code = (payload.pairingCode || '').trim();
|
||||
if (!code || !/^\d{4}$/.test(code)) {
|
||||
this._send(sender, { type: 'pairing-matched', success: false, error: '请输入4位数字配对码' });
|
||||
return;
|
||||
}
|
||||
const entry = this._pairingCodes[code];
|
||||
|
||||
Reference in New Issue
Block a user