fixed build erros (typescript errors)
This commit is contained in:
parent
5028d46900
commit
6e90075db3
|
@ -97,7 +97,7 @@ export default defineComponent({
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
root.$store
|
void root.$store
|
||||||
.dispatch('session/requestPasswordReset', {
|
.dispatch('session/requestPasswordReset', {
|
||||||
userid: userid.value
|
userid: userid.value
|
||||||
})
|
})
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, ref } from '@vue/composition-api';
|
import { defineComponent, ref } from '@vue/composition-api';
|
||||||
import { Loading, Notify } from 'quasar';
|
import { Loading, Notify } from 'quasar';
|
||||||
|
import { AxiosResponse } from 'axios';
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
// name: 'PageName'
|
// name: 'PageName'
|
||||||
|
@ -74,7 +75,7 @@ export default defineComponent({
|
||||||
password: password.value,
|
password: password.value,
|
||||||
token: root.$route.query.token
|
token: root.$route.query.token
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch((error: AxiosResponse) => {
|
||||||
if (error.status == 403) {
|
if (error.status == 403) {
|
||||||
Notify.create({
|
Notify.create({
|
||||||
group: false,
|
group: false,
|
||||||
|
|
|
@ -71,10 +71,7 @@
|
||||||
</q-file>
|
</q-file>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
<q-separator v-if="!props.newUser" />
|
<q-separator v-if="!props.newUser" />
|
||||||
<q-card-section
|
<q-card-section class="fit row justify-start content-center items-center" v-if="!props.newUser">
|
||||||
class="fit row justify-start content-center items-center"
|
|
||||||
v-if="!props.newUser"
|
|
||||||
>
|
|
||||||
<q-input
|
<q-input
|
||||||
v-if="isCurrentUser"
|
v-if="isCurrentUser"
|
||||||
class="col-xs-12 col-sm-6 col-md-4 q-pa-sm"
|
class="col-xs-12 col-sm-6 col-md-4 q-pa-sm"
|
||||||
|
@ -110,12 +107,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {
|
import { computed, defineComponent, ref, onBeforeMount } from '@vue/composition-api';
|
||||||
computed,
|
|
||||||
defineComponent,
|
|
||||||
ref,
|
|
||||||
onBeforeMount
|
|
||||||
} from '@vue/composition-api';
|
|
||||||
import { Store } from 'vuex';
|
import { Store } from 'vuex';
|
||||||
import { StateInterface } from 'src/store';
|
import { StateInterface } from 'src/store';
|
||||||
import { hasPermission } from 'src/utils/permission';
|
import { hasPermission } from 'src/utils/permission';
|
||||||
|
@ -174,17 +166,14 @@ export default defineComponent({
|
||||||
avatar.value = [];
|
avatar.value = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
const allRoles = computed(() =>
|
const allRoles = computed(() => store.state.user.roles.map(role => role.name));
|
||||||
store.state.user.roles.map(role => role.name)
|
|
||||||
);
|
|
||||||
const password = ref('');
|
const password = ref('');
|
||||||
const new_password = ref('');
|
const new_password = ref('');
|
||||||
const new_password2 = ref('');
|
const new_password2 = ref('');
|
||||||
|
|
||||||
function save() {
|
function save() {
|
||||||
let changed = <FG.User>props.user;
|
let changed = <FG.User>props.user;
|
||||||
if (typeof changed.birthday === 'string')
|
if (typeof changed.birthday === 'string') changed.birthday = new Date(changed.birthday);
|
||||||
changed.birthday = new Date(changed.birthday);
|
|
||||||
changed = Object.assign(changed, {
|
changed = Object.assign(changed, {
|
||||||
password: password.value
|
password: password.value
|
||||||
});
|
});
|
||||||
|
@ -196,10 +185,7 @@ export default defineComponent({
|
||||||
|
|
||||||
emit('update:user', changed);
|
emit('update:user', changed);
|
||||||
|
|
||||||
if (
|
if (avatar.value && (avatar.value.length > 0 || avatar.value instanceof File))
|
||||||
avatar.value &&
|
|
||||||
(avatar.value.length > 0 || avatar.value instanceof File)
|
|
||||||
)
|
|
||||||
store
|
store
|
||||||
.dispatch('user/uploadAvatar', {
|
.dispatch('user/uploadAvatar', {
|
||||||
user: changed,
|
user: changed,
|
||||||
|
@ -214,6 +200,8 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
|
|
||||||
function reset() {
|
function reset() {
|
||||||
|
//TODO: hier müssen wir uns etwas anderes einfallen lassen!
|
||||||
|
// eslint-disable-next-line vue/no-mutating-props
|
||||||
props.user = oldUser.value;
|
props.user = oldUser.value;
|
||||||
password.value = '';
|
password.value = '';
|
||||||
new_password.value = '';
|
new_password.value = '';
|
||||||
|
@ -230,9 +218,7 @@ export default defineComponent({
|
||||||
|
|
||||||
function isEmail(val: string | null) {
|
function isEmail(val: string | null) {
|
||||||
return (
|
return (
|
||||||
!val ||
|
!val || /^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w\w+)+$/.test(val) || 'E-Mail ist nicht valide.'
|
||||||
/^\w+([.-]?\w+)*@\w+([.-]?\w+)*(\.\w\w+)+$/.test(val) ||
|
|
||||||
'E-Mail ist nicht valide.'
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue