mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-05-11 13:17:29 +08:00
feat: add reaction token
This commit is contained in:
@@ -44,7 +44,7 @@ export default {
|
|||||||
width: 32px;
|
width: 32px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
color: white;
|
color: var(--text-color);
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|||||||
@@ -33,7 +33,10 @@ let cachedTypes = null
|
|||||||
const fetchTypes = async () => {
|
const fetchTypes = async () => {
|
||||||
if (cachedTypes) return cachedTypes
|
if (cachedTypes) return cachedTypes
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`${API_BASE_URL}/api/reaction-types`)
|
const token = getToken()
|
||||||
|
const res = await fetch(`${API_BASE_URL}/api/reaction-types`, {
|
||||||
|
headers: { Authorization: `Bearer ${token}` }
|
||||||
|
})
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
cachedTypes = await res.json()
|
cachedTypes = await res.json()
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user