fix: AI verification code extraction failure

This commit is contained in:
aslost
2026-08-26 22:23:02 +08:00
parent 55110eebec
commit 5fe5274589
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -86,7 +86,8 @@ const dbInit = {
c.env.db.prepare(`CREATE INDEX IF NOT EXISTS idx_user_type ON user(type)`),
c.env.db.prepare(`CREATE INDEX IF NOT EXISTS idx_attachments_email_type ON attachments(email_id, type)`),
c.env.db.prepare(`CREATE INDEX IF NOT EXISTS idx_role_perm_role ON role_perm(role_id)`),
c.env.db.prepare(`CREATE INDEX IF NOT EXISTS idx_oauth_oauth_user_id ON oauth(oauth_user_id)`)
c.env.db.prepare(`CREATE INDEX IF NOT EXISTS idx_oauth_oauth_user_id ON oauth(oauth_user_id)`),
c.env.db.prepare(`CREATE INDEX IF NOT EXISTS idx_oauth_user_id ON oauth(user_id)`)
]);
} catch (e) {
console.warn(`跳过索引:${e.message}`);
+1 -1
View File
@@ -35,7 +35,7 @@ const aiService = {
});
const content = typeof result === 'string' ? result : result?.response || '';
const json = JSON.parse(content);
const json = typeof content === 'string' ? JSON.parse(content) : content;
if (typeof json.code !== 'string') {
return '';
}