User sign in

This commit is contained in:
2024-03-28 20:44:13 +08:00
parent 3a1cf006f4
commit 96526da432
33 changed files with 750 additions and 34 deletions

View File

@@ -43,7 +43,7 @@ async function deletePost() {
loading.value = true
const res = await request("interactive", url, {
method: "DELETE",
headers: { Authorization: `Bearer ${getAtk()}` }
headers: { Authorization: `Bearer ${await getAtk()}` }
})
if (res.status !== 200) {
error.value = await res.text()

View File

@@ -63,7 +63,7 @@ async function submit(evt: SubmitEvent) {
loading.value = true
const res = await request("interactive", url, {
method: method,
headers: { "Content-Type": "application/json", Authorization: `Bearer ${getAtk()}` },
headers: { "Content-Type": "application/json", Authorization: `Bearer ${await getAtk()}` },
body: JSON.stringify(payload)
})
if (res.status !== 200) {

View File

@@ -38,7 +38,7 @@ async function inviteMember(evt: SubmitEvent) {
loading.value = true
const res = await request("interactive", `/api/realms/${props.item?.id}/invite`, {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: `Bearer ${getAtk()}` },
headers: { "Content-Type": "application/json", Authorization: `Bearer ${await getAtk()}` },
body: JSON.stringify({
account_name: targetName.value
})

View File

@@ -97,7 +97,7 @@ async function kickMember(item: any) {
loading.value = true
const res = await request("interactive", `/api/realms/${props.item?.id}/kick`, {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: `Bearer ${getAtk()}` },
headers: { "Content-Type": "application/json", Authorization: `Bearer ${await getAtk()}` },
body: JSON.stringify({
account_name: item.account.name
})