user module + translations

This commit is contained in:
2026-02-05 16:38:34 +02:00
parent 4d95a40c37
commit 6e95ac7999
9 changed files with 185 additions and 35 deletions
+21 -1
View File
@@ -3,7 +3,7 @@ import { useAppStore } from '@/stores/app';
export default {
data(){
return {
store: null
store: null,
}
},
created(){
@@ -32,5 +32,25 @@ export default {
this.user = response.data.user;
return this.user;
},
getErrorText(error){
let msg = error?.response?.data?.error || error?.message;
if (msg){
if (typeof msg == 'object'){
return JSON.stringify(msg);
}else if (this.l.errors[msg]) {
return this.l.errors[msg]
}else {
return msg;
}
}else{
return error;
}
},
toast(text, color, timeout=3000){
this.store.snackbar.text = text;
this.store.snackbar.color = color;
this.store.snackbar.timeout = timeout;
this.store.snackbar.show = true;
}
}
}