2025-04-23 00:42:08 -05:00
|
|
|
import { reactive } from 'vue'
|
|
|
|
|
|
|
|
export const user_store = reactive({
|
|
|
|
Avatar_Decoration: '',
|
|
|
|
Avatar: '',
|
|
|
|
Id: '',
|
|
|
|
Global_Name: '',
|
|
|
|
Username: '',
|
|
|
|
})
|
|
|
|
|
|
|
|
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) => {
|
|
|
|
user_store.Avatar_Decoration =
|
|
|
|
'https://cdn.discordapp.com/avatar-decoration-presets/' +
|
|
|
|
userjson.Avatar_Decoration_Data.Asset +
|
|
|
|
'.png'
|
|
|
|
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
|
|
|
|
})
|
|
|
|
.catch(() => {})
|
|
|
|
})
|
|
|
|
.catch(() => {})
|
2025-04-23 00:42:08 -05:00
|
|
|
}
|