mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-04-10 15:08:31 +00:00
Merge pull request #14 from Jasonzhu1207/fix/chinese-garbled-text
fix: clean up garbled Chinese text
This commit is contained in:
@@ -729,7 +729,7 @@ export class ConfigService {
|
|||||||
// === 工具方法 ===
|
// === 工具方法 ===
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前 wxid 对应的图片密钥,优先从 wxidConfigs 中取,找不到则回退到全局<EFBFBD><EFBFBD>置
|
* 获取当前 wxid 对应的图片密钥,优先从 wxidConfigs 中取,找不到则回退到全局配置
|
||||||
*/
|
*/
|
||||||
getImageKeysForCurrentWxid(): { xorKey: unknown; aesKey: string } {
|
getImageKeysForCurrentWxid(): { xorKey: unknown; aesKey: string } {
|
||||||
const wxid = this.get('myWxid')
|
const wxid = this.get('myWxid')
|
||||||
|
|||||||
@@ -934,7 +934,7 @@ export class ImageDecryptService {
|
|||||||
} catch { }
|
} catch { }
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- 绛栫暐 B: 鏂扮増 Session 鍝堝笇璺緞鐚滄祴 ---
|
// --- 策略 B: 新版 Session 哈希路径猜测 ---
|
||||||
try {
|
try {
|
||||||
const entries = await fs.readdir(root, { withFileTypes: true })
|
const entries = await fs.readdir(root, { withFileTypes: true })
|
||||||
const sessionDirs = entries
|
const sessionDirs = entries
|
||||||
@@ -1833,7 +1833,7 @@ export class ImageDecryptService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 浠?wxgf 鏁版嵁涓彁鍙?HEVC NALU 瑁告祦
|
* 从 wxgf 数据中提取 HEVC NALU 裸流
|
||||||
*/
|
*/
|
||||||
private extractHevcNalu(buffer: Buffer): Buffer | null {
|
private extractHevcNalu(buffer: Buffer): Buffer | null {
|
||||||
const nalUnits: Buffer[] = []
|
const nalUnits: Buffer[] = []
|
||||||
|
|||||||
@@ -279,7 +279,7 @@ class InsightService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 测<EFBFBD><EFBFBD><EFBFBD> API 连接,返回 { success, message }。
|
* 测试 API 连接,返回 { success, message }。
|
||||||
* 供设置页"测试连接"按钮调用。
|
* 供设置页"测试连接"按钮调用。
|
||||||
*/
|
*/
|
||||||
async testConnection(): Promise<{ success: boolean; message: string }> {
|
async testConnection(): Promise<{ success: boolean; message: string }> {
|
||||||
@@ -438,7 +438,7 @@ class InsightService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取今日全局已触发次数(所有会话合计),用于 prompt 中告知模<EFBFBD><EFBFBD><EFBFBD>全局上下文。
|
* 获取今日全局已触发次数(所有会话合计),用于 prompt 中告知模型全局上下文。
|
||||||
*/
|
*/
|
||||||
private getTodayTotalTriggerCount(): number {
|
private getTodayTotalTriggerCount(): number {
|
||||||
this.resetIfNewDay()
|
this.resetIfNewDay()
|
||||||
@@ -668,7 +668,7 @@ class InsightService {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── 构建 prompt ─────────────<EFBFBD><EFBFBD><EFBFBD>───────────────────────────────<EFBFBD><EFBFBD><EFBFBD>────────────
|
// ── 构建 prompt ────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
// 今日触发统计(让模型具备时间与克制感)
|
// 今日触发统计(让模型具备时间与克制感)
|
||||||
const sessionTriggerTimes = this.recordTrigger(sessionId)
|
const sessionTriggerTimes = this.recordTrigger(sessionId)
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
|
|||||||
|
|
||||||
setHttpApiToken(token)
|
setHttpApiToken(token)
|
||||||
await configService.setHttpApiToken(token)
|
await configService.setHttpApiToken(token)
|
||||||
showMessage('已生成<EFBFBD><EFBFBD>保存新的 Access Token', true)
|
showMessage('已生成并保存新的 Access Token', true)
|
||||||
}
|
}
|
||||||
|
|
||||||
const clearApiToken = async () => {
|
const clearApiToken = async () => {
|
||||||
@@ -635,7 +635,7 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
|
|||||||
showMessage(`已切换到${channelLabel}更新渠道,正在检查更新`, true)
|
showMessage(`已切换到${channelLabel}更新渠道,正在检查更新`, true)
|
||||||
await handleCheckUpdate()
|
await handleCheckUpdate()
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
showMessage(`切换更新渠道<EFBFBD><EFBFBD>败: ${e}`, false)
|
showMessage(`切换更新渠道失败: ${e}`, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1230,7 +1230,7 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
|
|||||||
if (result.success && result.aesKey) {
|
if (result.success && result.aesKey) {
|
||||||
if (typeof result.xorKey === 'number') setImageXorKey(`0x${result.xorKey.toString(16).toUpperCase().padStart(2, '0')}`)
|
if (typeof result.xorKey === 'number') setImageXorKey(`0x${result.xorKey.toString(16).toUpperCase().padStart(2, '0')}`)
|
||||||
setImageAesKey(result.aesKey)
|
setImageAesKey(result.aesKey)
|
||||||
setImageKeyStatus('已获取图片<EFBFBD><EFBFBD>钥')
|
setImageKeyStatus('已获取图片密钥')
|
||||||
showMessage('已自动获取图片密钥', true)
|
showMessage('已自动获取图片密钥', true)
|
||||||
const newXorKey = typeof result.xorKey === 'number' ? result.xorKey : 0
|
const newXorKey = typeof result.xorKey === 'number' ? result.xorKey : 0
|
||||||
const newAesKey = result.aesKey
|
const newAesKey = result.aesKey
|
||||||
@@ -3232,7 +3232,7 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
|
|||||||
value={`http://${httpApiHost}:${httpApiPort}`}
|
value={`http://${httpApiHost}:${httpApiPort}`}
|
||||||
readOnly
|
readOnly
|
||||||
/>
|
/>
|
||||||
<button className="btn btn-secondary" onClick={handleCopyApiUrl} title="复<EFBFBD><EFBFBD><EFBFBD>">
|
<button className="btn btn-secondary" onClick={handleCopyApiUrl} title="复制">
|
||||||
<Copy size={16} />
|
<Copy size={16} />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -3366,7 +3366,7 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
|
|||||||
try {
|
try {
|
||||||
const verifyResult = await window.electronAPI.auth.hello('请验证您的身份以开启 Windows Hello')
|
const verifyResult = await window.electronAPI.auth.hello('请验证您的身份以开启 Windows Hello')
|
||||||
if (!verifyResult.success) {
|
if (!verifyResult.success) {
|
||||||
showMessage(verifyResult.error || 'Windows Hello <EFBFBD><EFBFBD>证失败', false)
|
showMessage(verifyResult.error || 'Windows Hello 验证失败', false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3598,7 +3598,7 @@ function SettingsPage({ onClose }: SettingsPageProps = {}) {
|
|||||||
onClick={handleSetupHello}
|
onClick={handleSetupHello}
|
||||||
disabled={!helloAvailable || isSettingHello || !authEnabled || !helloPassword}
|
disabled={!helloAvailable || isSettingHello || !authEnabled || !helloPassword}
|
||||||
>
|
>
|
||||||
{isSettingHello ? '<EFBFBD><EFBFBD><EFBFBD>置中...' : '开启与设置'}
|
{isSettingHello ? '配置中...' : '开启与设置'}
|
||||||
</button>
|
</button>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1127,7 +1127,7 @@ export default function SnsPage() {
|
|||||||
activeContactsCountTaskIdRef.current = null
|
activeContactsCountTaskIdRef.current = null
|
||||||
}
|
}
|
||||||
finishBackgroundTask(taskId, 'completed', {
|
finishBackgroundTask(taskId, 'completed', {
|
||||||
detail: '鑱旂郴浜烘湅鍙嬪湀鏉℃暟琛ョ畻瀹屾垚',
|
detail: '联系人朋友圈条数补算完成',
|
||||||
progressText: `${totalTargets}/${totalTargets}`
|
progressText: `${totalTargets}/${totalTargets}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -505,7 +505,7 @@ export async function setExportDefaultTxtColumns(columns: string[]): Promise<voi
|
|||||||
await config.set(CONFIG_KEYS.EXPORT_DEFAULT_TXT_COLUMNS, columns)
|
await config.set(CONFIG_KEYS.EXPORT_DEFAULT_TXT_COLUMNS, columns)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取导出默认并发<EFBFBD><EFBFBD>
|
// 获取导出默认并发数
|
||||||
export async function getExportDefaultConcurrency(): Promise<number | null> {
|
export async function getExportDefaultConcurrency(): Promise<number | null> {
|
||||||
const value = await config.get(CONFIG_KEYS.EXPORT_DEFAULT_CONCURRENCY)
|
const value = await config.get(CONFIG_KEYS.EXPORT_DEFAULT_CONCURRENCY)
|
||||||
if (typeof value === 'number' && Number.isFinite(value)) return value
|
if (typeof value === 'number' && Number.isFinite(value)) return value
|
||||||
|
|||||||
Reference in New Issue
Block a user