feat: grok Usage Guidelines Violation Fee (#2753)

* feat: grok Usage Guidelines Violation Fee ui setting

* feat: grok Usage Guidelines Violation Fee consume log

* fix: grok Usage Guidelines Violation Fee log detail
This commit is contained in:
Seefs
2026-01-26 20:20:30 +08:00
committed by GitHub
parent cc1da72d10
commit 478f1871d6
9 changed files with 507 additions and 70 deletions

View File

@@ -18,9 +18,16 @@ For commercial licensing, please contact support@quantumnous.com
*/
export function getLogOther(otherStr) {
if (otherStr === undefined || otherStr === '') {
otherStr = '{}';
if (otherStr === undefined || otherStr === null || otherStr === '') {
return {};
}
if (typeof otherStr === 'object') {
return otherStr;
}
try {
return JSON.parse(otherStr);
} catch (e) {
console.error(`Failed to parse record.other: "${otherStr}".`, e);
return null;
}
let other = JSON.parse(otherStr);
return other;
}