Add chat box

This commit is contained in:
Yang Luo
2023-04-09 22:42:33 +08:00
parent 8b9e0ba96b
commit 754fa1e745
6 changed files with 127 additions and 24 deletions

View File

@ -24,6 +24,16 @@ export function getMessages(owner, page = "", pageSize = "", field = "", value =
}).then(res => res.json());
}
export function getChatMessages(chat) {
return fetch(`${Setting.ServerUrl}/api/get-messages?chat=${chat}`, {
method: "GET",
credentials: "include",
headers: {
"Accept-Language": Setting.getAcceptLanguage(),
},
}).then(res => res.json());
}
export function getMessage(owner, name) {
return fetch(`${Setting.ServerUrl}/api/get-message?id=${owner}/${encodeURIComponent(name)}`, {
method: "GET",