Skip to content

Commit

Permalink
优化接口
Browse files Browse the repository at this point in the history
  • Loading branch information
admin8756 committed May 3, 2024
1 parent a4d1441 commit d2e1e57
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions api/ai.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
export default function handler(request, response) {
let { text } = request.query
let { text } = request.query;
text = text.replace(/\?/g, '!');
text = text.replace('吗', '');
text = text.replace('你','我')
response.status(200).json(text);
if (text.includes('你')) {
text = text.replace('你', '我');
return response.status(200).json(text);
}
if (text.includes('我')) {
text = text.replace('我', '你');
response.status(200).json(text);
}
}

1 comment on commit d2e1e57

@vercel
Copy link

@vercel vercel bot commented on d2e1e57 May 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please # to comment.