Spaces:
Running
Running
CassiopeiaCode
commited on
Commit
·
8260bce
1
Parent(s):
68b69f4
fix: 修复send函数中的baseUrl和authHeader引用错误
Browse files- 移除send()中对已删除函数baseUrl()和authHeader()的调用
- 简化headers构建,移除authorization(开发模式)
- frontend/index.html +0 -4
frontend/index.html
CHANGED
|
@@ -551,8 +551,6 @@ async function refreshAccount(id){
|
|
| 551 |
}
|
| 552 |
|
| 553 |
async function send() {
|
| 554 |
-
const base = baseUrl();
|
| 555 |
-
const auth = authHeader();
|
| 556 |
const model = document.getElementById('model').value.trim();
|
| 557 |
const stream = document.getElementById('stream').value === 'true';
|
| 558 |
const out = document.getElementById('out');
|
|
@@ -563,9 +561,7 @@ async function send() {
|
|
| 563 |
catch(e){ out.textContent = 'messages 不是合法 JSON'; return; }
|
| 564 |
|
| 565 |
const body = { model, messages, stream };
|
| 566 |
-
|
| 567 |
const headers = { 'content-type': 'application/json' };
|
| 568 |
-
if (auth) headers['authorization'] = auth;
|
| 569 |
|
| 570 |
if (!stream) {
|
| 571 |
const r = await fetch(api('/v1/chat/completions'), {
|
|
|
|
| 551 |
}
|
| 552 |
|
| 553 |
async function send() {
|
|
|
|
|
|
|
| 554 |
const model = document.getElementById('model').value.trim();
|
| 555 |
const stream = document.getElementById('stream').value === 'true';
|
| 556 |
const out = document.getElementById('out');
|
|
|
|
| 561 |
catch(e){ out.textContent = 'messages 不是合法 JSON'; return; }
|
| 562 |
|
| 563 |
const body = { model, messages, stream };
|
|
|
|
| 564 |
const headers = { 'content-type': 'application/json' };
|
|
|
|
| 565 |
|
| 566 |
if (!stream) {
|
| 567 |
const r = await fetch(api('/v1/chat/completions'), {
|