fix: wrong url join
This commit is contained in:
@@ -202,12 +202,12 @@ export default class LingChairClient {
|
|||||||
form.append('file_name', fileName)
|
form.append('file_name', fileName)
|
||||||
chatId && form.append('chat_id', chatId)
|
chatId && form.append('chat_id', chatId)
|
||||||
const url = new URL(this.server_url)
|
const url = new URL(this.server_url)
|
||||||
const re = await fetch(({
|
const re = await fetch((({
|
||||||
'ws:': 'http:',
|
'ws:': 'http:',
|
||||||
'wss:': 'https:',
|
'wss:': 'https:',
|
||||||
'http:': 'http:',
|
'http:': 'http:',
|
||||||
'https:': 'https:',
|
'https:': 'https:',
|
||||||
})[url.protocol] || 'http:' + '//' + url.host + '/upload_file', {
|
})[url.protocol] || 'http:') + '//' + url.host + '/upload_file', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
"Token": this.access_token,
|
"Token": this.access_token,
|
||||||
|
|||||||
Reference in New Issue
Block a user