2025-04-23 00:42:08 -05:00
|
|
|
import { reactive } from 'vue'
|
|
|
|
|
|
|
|
export const user_store = reactive({
|
2025-04-24 15:30:36 -05:00
|
|
|
avatar_decoration: '',
|
|
|
|
avatar: '',
|
|
|
|
id: '',
|
|
|
|
global_name: '',
|
|
|
|
username: '',
|
2025-04-23 00:42:08 -05:00
|
|
|
})
|
|
|
|
|
|
|
|
export function update_info() {
|
|
|
|
fetch('http://localhost:31337/dashboard', {
|
|
|
|
credentials: 'include',
|
|
|
|
})
|
2025-04-23 13:12:43 -05:00
|
|
|
.then((res) => {
|
|
|
|
res
|
|
|
|
.json()
|
|
|
|
.then((userjson) => {
|
2025-04-24 15:30:36 -05:00
|
|
|
console.log(userjson)
|
|
|
|
user_store.avatar_decoration =
|
2025-04-23 13:12:43 -05:00
|
|
|
'https://cdn.discordapp.com/avatar-decoration-presets/' +
|
2025-04-24 15:30:36 -05:00
|
|
|
userjson.avatar_decoration_data.asset +
|
2025-04-23 13:12:43 -05:00
|
|
|
'.png'
|
2025-04-24 15:30:36 -05:00
|
|
|
console.log(user_store)
|
|
|
|
user_store.avatar =
|
|
|
|
'https://cdn.discordapp.com/avatars/' + userjson.id + '/' + userjson.avatar + '.png'
|
|
|
|
user_store.id = 'https://discord.com/users/' + userjson.id
|
|
|
|
user_store.global_name = userjson.global_name
|
|
|
|
user_store.username = userjson.username
|
2025-04-23 13:12:43 -05:00
|
|
|
})
|
|
|
|
.catch(() => {})
|
|
|
|
})
|
|
|
|
.catch(() => {})
|
2025-04-23 00:42:08 -05:00
|
|
|
}
|