mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-17 16:06:38 +08:00
fix: 修复聊天环境变量替换不完全 (close #542)
This commit is contained in:
parent
fe0ed128c6
commit
3e2ae29ba0
@ -393,8 +393,8 @@ const TokensTable = () => {
|
|||||||
serverAddress = window.location.origin;
|
serverAddress = window.location.origin;
|
||||||
}
|
}
|
||||||
let encodedServerAddress = encodeURIComponent(serverAddress);
|
let encodedServerAddress = encodeURIComponent(serverAddress);
|
||||||
url = url.replace('{address}', encodedServerAddress);
|
url = url.replaceAll('{address}', encodedServerAddress);
|
||||||
url = url.replace('{key}', 'sk-' + record.key);
|
url = url.replaceAll('{key}', 'sk-' + record.key);
|
||||||
// console.log(url);
|
// console.log(url);
|
||||||
// const chatLink = localStorage.getItem('chat_link');
|
// const chatLink = localStorage.getItem('chat_link');
|
||||||
// const mjLink = localStorage.getItem('chat_link2');
|
// const mjLink = localStorage.getItem('chat_link2');
|
||||||
|
@ -20,8 +20,8 @@ const ChatPage = () => {
|
|||||||
if (Array.isArray(chats) && chats.length > 0) {
|
if (Array.isArray(chats) && chats.length > 0) {
|
||||||
for (let k in chats[id]) {
|
for (let k in chats[id]) {
|
||||||
link = chats[id][k];
|
link = chats[id][k];
|
||||||
link = link.replace('{address}', encodeURIComponent(serverAddress));
|
link = link.replaceAll('{address}', encodeURIComponent(serverAddress));
|
||||||
link = link.replace('{key}', 'sk-' + key);
|
link = link.replaceAll('{key}', 'sk-' + key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user