fix: AI verification code extraction failure
This commit is contained in:
@@ -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}`);
|
||||
|
||||
@@ -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 '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user