【优雅再+】GPT4私人拼车神器【UI版】——聊天隔离+站密码+自动刷新token

牛v

1 个赞

怎么知道创建了多少用户

我没这个需求。

如果有,可以考虑给 KV 里添加登录的 unique_name

1 个赞

有拼GPT4的车么…

有效有效

炒鸡优雅便捷

强啊

不错 但是有个疑问 这个支持普通账号组token池的方式么

高级啊,多谢大佬分享!
问题来了没有refresh Token也可以吗

等级不够,含泪放弃,没得rt

也可以,需要每 10 天手动设置 at

不支持,我就一个号小范围用,没有这样的需求

始皇更新了功能之后:

如果在主页面进入了 voice 功能,再退出会直接进入原 new.oaifree.com 页面,这个有办法解决不~

始皇更新了 voice 的反代:一文教你如何反代oaifree voice
改了一下 worker 代码:

// 加在开头,或者自己实现
function getSubdomain(hostname) {
  const parts = hostname.split('.');
  // Assuming the domain has at least three parts (subdomain, domain, tld)
  if (parts.length >= 3) {
    return parts[0];  // return the first part which is the subdomain
  }
  return null;
}

function replaceSubdomain(hostname, newSubdomain) {
  const parts = hostname.split('.');
  if (parts.length >= 3) {
    parts[0] = newSubdomain;
    return parts.join('.');
  }
  return hostname;  // 如果不是三级域名,则返回原始主机名
}

// 替换掉 async function handleRequest(request) 的逻辑
const subDomain = getSubdomain(requestURL.hostname);
  // 一文教你如何反代oaifree voice: https://linux.do/t/topic/107417
  if (subDomain === 'voice') {
    if (requestURL.pathname === '/' && !requestURL.search) {
      // 重定向到 chat,否则直接访问还是会回到 new.oaifree.com
      const chatBase = replaceSubdomain(requestURL.hostname, 'chat');
      return Response.redirect(`https://${chatBase}`, 301)  // 301 永久重定向
    }
    requestURL.host = 'voice.oaifree.com';
    return fetch(new Request(requestURL, request));
  }

  const path = requestURL.pathname;
  // ------------ 反代到 new.oaifree.com
  if (path !== '/auth/login_auth0' && path !== '/auth/login') {
    const voiceBase = replaceSubdomain(requestURL.hostname, 'voice');
    requestURL.host = 'new.oaifree.com';
    // + https://linux.do/t/topic/107417#voice-httpsvoiceabccom-httpsnewoaifreecom-x-voice-base-3
    const modifiedRequest = new Request(requestURL, request);
    modifiedRequest.headers.set('X-Voice-Base', `https://${voiceBase}`);
    return fetch(modifiedRequest);
  }

同时,在worker里添加一个新的域‘voice’

1 个赞

棒棒,

很优雅

mark 有需要的时候来用

From 软件开发 to 开发调优

1 个赞

请问这个代码能用吗?我复制到workers怎么显示错误:

Cannot read properties of null (reading ‘split’)