Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b6f4ca0b
authored
Nov 05, 2024
by
CalciumIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复聊天环境变量替换不完全 (close #542)
parent
52e7230c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
web/src/components/TokensTable.js
+2
-2
web/src/pages/Chat/index.js
+2
-2
No files found.
web/src/components/TokensTable.js
View file @
b6f4ca0b
...
@@ -393,8 +393,8 @@ const TokensTable = () => {
...
@@ -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
.
replace
All
(
'{address}'
,
encodedServerAddress
);
url
=
url
.
replace
(
'{key}'
,
'sk-'
+
record
.
key
);
url
=
url
.
replace
All
(
'{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');
...
...
web/src/pages/Chat/index.js
View file @
b6f4ca0b
...
@@ -20,8 +20,8 @@ const ChatPage = () => {
...
@@ -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
.
replace
All
(
'{address}'
,
encodeURIComponent
(
serverAddress
));
link
=
link
.
replace
(
'{key}'
,
'sk-'
+
key
);
link
=
link
.
replace
All
(
'{key}'
,
'sk-'
+
key
);
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment