integrate the user module
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
},
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user