File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 11( function ( global ) {
22 function openBatchStream ( taskId , apiKey , handlers = { } ) {
33 if ( ! taskId ) return null ;
4- const url = `/api/v1/admin/batch/${ taskId } /stream?api_key=${ encodeURIComponent ( apiKey || '' ) } ` ;
4+ // 去掉 Bearer 前缀,后端期望纯 api_key
5+ const cleanKey = apiKey ? apiKey . replace ( / ^ B e a r e r \s + / i, '' ) : '' ;
6+ const url = `/api/v1/admin/batch/${ taskId } /stream?api_key=${ encodeURIComponent ( cleanKey ) } ` ;
57 const es = new EventSource ( url ) ;
68
79 es . onmessage = ( e ) => {
Original file line number Diff line number Diff line change @@ -39,8 +39,10 @@ const LOCALE_MAP = {
3939 "dynamic_statsig" : { title : "动态指纹" , desc : "是否启用动态生成 Statsig 值。" } ,
4040 "filter_tags" : { title : "过滤标签" , desc : "自动过滤 Grok 响应中的特殊标签。" } ,
4141 "timeout" : { title : "超时时间" , desc : "请求 Grok 服务的超时时间(秒)。" } ,
42- "base_proxy_url" : { title : "基础代理 URL" , desc : "代理请求到 Grok 官网的基础服务地址。" } ,
43- "asset_proxy_url" : { title : "资源代理 URL" , desc : "代理请求到 Grok 官网的静态资源(图片/视频)地址。" } ,
42+ "api_base" : { title : "API 反代地址" , desc : "替换 grok.com 的反向代理地址,如 Cloudflare Worker URL。" } ,
43+ "asset_base" : { title : "资源反代地址" , desc : "替换 assets.grok.com 的反向代理地址。" } ,
44+ "base_proxy_url" : { title : "HTTP 代理" , desc : "HTTP/SOCKS5 代理地址,用于请求 Grok API。" } ,
45+ "asset_proxy_url" : { title : "资源代理" , desc : "HTTP/SOCKS5 代理地址,用于请求静态资源。" } ,
4446 "cf_clearance" : { title : "CF Clearance" , desc : "Cloudflare 验证 Cookie,用于验证 Cloudflare 的验证。" } ,
4547 "max_retry" : { title : "最大重试" , desc : "请求 Grok 服务失败时的最大重试次数。" } ,
4648 "retry_status_codes" : { title : "重试状态码" , desc : "触发重试的 HTTP 状态码列表。" }
You can’t perform that action at this time.
0 commit comments