Skip to content

Commit

Permalink
[Fix] 🐛 BingAPI Crash on Vercel
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry-zklcdc committed Mar 9, 2024
1 parent 861c16d commit 9675029
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions api/v1/vercel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,27 @@ export const config = {
supportsResponseStreaming: true,
};

/**
* 随机整数 [min,max)
* @param {number} min
* @param {number} max
* @returns
*/
const getRandomInt = (min, max) => Math.floor(Math.random() * (max - min)) + min;

/**
* 生成随机字符串
* @param {number} e
* @returns
*/
const randomString = (e) => {
e = e || 32;
const t = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678_-+";
var n = "";
for (let i = 0; i < e; i++) n += t.charAt(getRandomInt(0, t.length));
return n;
}

export default function ChatHandler(request) {
const CUSTOM_OPTIONS = {
BYPASS_SERVER: 'https://bypass.zklcdc.xyz',
Expand Down

0 comments on commit 9675029

Please sign in to comment.