mirror of
https://github.com/hicccc77/WeFlow.git
synced 2026-03-24 23:06:51 +00:00
debug: 添加详细日志输出
This commit is contained in:
@@ -75,12 +75,17 @@ export class KeyServiceMac {
|
|||||||
onStatus?.('正在获取数据库密钥...', 0)
|
onStatus?.('正在获取数据库密钥...', 0)
|
||||||
|
|
||||||
const keyPtr = this.GetDbKey()
|
const keyPtr = this.GetDbKey()
|
||||||
|
console.log('[KeyServiceMac] GetDbKey returned:', keyPtr, 'type:', typeof keyPtr)
|
||||||
|
|
||||||
if (!keyPtr) {
|
if (!keyPtr) {
|
||||||
onStatus?.('获取失败:未知错误', 2)
|
onStatus?.('获取失败:未知错误', 2)
|
||||||
return { success: false, error: '未知错误' }
|
return { success: false, error: '未知错误' }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('[KeyServiceMac] Attempting to decode pointer...')
|
||||||
const result = this.koffi.decode(keyPtr, 'string')
|
const result = this.koffi.decode(keyPtr, 'string')
|
||||||
|
console.log('[KeyServiceMac] Decoded result:', result)
|
||||||
|
|
||||||
this.FreeString(keyPtr)
|
this.FreeString(keyPtr)
|
||||||
|
|
||||||
// 检查是否是错误信息
|
// 检查是否是错误信息
|
||||||
@@ -103,8 +108,10 @@ export class KeyServiceMac {
|
|||||||
onStatus?.('密钥获取成功', 1)
|
onStatus?.('密钥获取成功', 1)
|
||||||
return { success: true, key: result }
|
return { success: true, key: result }
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
|
console.error('[KeyServiceMac] Error:', e)
|
||||||
|
console.error('[KeyServiceMac] Stack:', e.stack)
|
||||||
onStatus?.('获取失败: ' + e.message, 2)
|
onStatus?.('获取失败: ' + e.message, 2)
|
||||||
return { success: false, error: e.message }
|
return { success: false, error: e.message + '\n' + e.stack }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user