integrate the user module

This commit is contained in:
2026-02-05 13:50:43 +02:00
parent 9d22fe8413
commit 4d95a40c37
15 changed files with 220 additions and 162 deletions
-1
View File
@@ -3,7 +3,6 @@ import { VideoPlayer } from '@/components/InteractiveObjects/VideoPlayer';
import { GameEngine } from '@/lib/GameEngine';
import { Hero } from '@/lib/Hero';
import { autoScale, getBoundingBox, getBoundingBoxSize } from '@/lib/MeshUtils';
import Utils from '@/lib/Utils';
let gameEngine = null;
export default {
+36
View File
@@ -0,0 +1,36 @@
import { useAppStore } from '@/stores/app';
export default {
data(){
return {
store: null
}
},
created(){
this.store = useAppStore();
},
computed: {
user: {
get() {
return this.store.user;
},
set(value) {
this.store.user = value;
}
},
roles(){
let roles = {};
this.user && this.user.roles && this.user.roles.forEach(r=>{
roles[r] = true;
})
return roles;
},
},
methods: {
async loadUser() {
let response = await this.$api.user.load();
this.user = response.data.user;
return this.user;
},
}
}