mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-01 03:55:57 +00:00
Log in functionality
This commit is contained in:
@@ -14,12 +14,12 @@
|
||||
<ValidationProvider tag="div" mode="passive" class="input-wrapper" name="E-Mail" rules="required"
|
||||
v-slot="{ errors }">
|
||||
<input v-model="loginEmail" :placeholder="$t('page_login.placeholder_email')" type="email"
|
||||
:class="{'is-error': errors[0]}"/>
|
||||
:class="{'is-error': errors[0]}" />
|
||||
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
|
||||
</ValidationProvider>
|
||||
|
||||
<AuthButton icon="chevron-right" :text="$t('page_login.button_next')" :loading="isLoading"
|
||||
:disabled="isLoading"/>
|
||||
:disabled="isLoading" />
|
||||
</ValidationObserver>
|
||||
|
||||
<span v-if="config.userRegistration" class="additional-link">{{ $t('page_login.registration_text') }}
|
||||
@@ -44,12 +44,12 @@
|
||||
v-slot="{ errors }">
|
||||
<input v-model="loginPassword" :placeholder="$t('page_sign_in.placeholder_password')"
|
||||
type="password"
|
||||
:class="{'is-error': errors[0]}"/>
|
||||
:class="{'is-error': errors[0]}" />
|
||||
<span class="error-message" v-if="errors[0]">{{ errors[0] }}</span>
|
||||
</ValidationProvider>
|
||||
|
||||
<AuthButton icon="chevron-right" :text="$t('page_sign_in.button_log_in')" :loading="isLoading"
|
||||
:disabled="isLoading"/>
|
||||
:disabled="isLoading" />
|
||||
</ValidationObserver>
|
||||
|
||||
<span class="additional-link">{{ $t('page_sign_in.password_reset_text') }}
|
||||
@@ -166,7 +166,7 @@
|
||||
|
||||
// Send request to get user token
|
||||
axios
|
||||
.post('/api/user/login', {
|
||||
.post('/login', {
|
||||
email: this.loginEmail,
|
||||
password: this.loginPassword,
|
||||
})
|
||||
@@ -209,6 +209,11 @@
|
||||
created() {
|
||||
this.$scrollTop()
|
||||
this.$store.commit('PROCESSING_POPUP', undefined)
|
||||
|
||||
if (this.config.isDemo) {
|
||||
this.loginEmail = 'howdy@hi5ve.digital'
|
||||
this.loginPassword = 'vuefilemanager'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<span class="empty-note navigator" v-if="tree.length == 0">
|
||||
{{ $t('sidebar.folders_empty') }}
|
||||
</span>
|
||||
<TreeMenuNavigator class="folder-tree" :depth="0" :nodes="items" v-for="items in tree" :key="items.unique_id"/>
|
||||
<TreeMenuNavigator class="folder-tree" :depth="0" :nodes="items" v-for="items in tree" :key="items.id"/>
|
||||
</ContentGroup>
|
||||
|
||||
<!--Favourites-->
|
||||
@@ -55,7 +55,7 @@
|
||||
{{ $t('sidebar.favourites_empty') }}
|
||||
</span>
|
||||
|
||||
<a @click.stop="openFolder(folder)" class="menu-list-item" :class="{'is-current': (folder && currentFolder) && (currentFolder.unique_id === folder.unique_id)}" v-for="(folder, i) in favourites" :key="i">
|
||||
<a @click.stop="openFolder(folder)" class="menu-list-item" :class="{'is-current': (folder && currentFolder) && (currentFolder.id === folder.id)}" v-for="folder in favourites" :key="folder.id">
|
||||
<div>
|
||||
<folder-icon size="17" class="folder-icon"></folder-icon>
|
||||
<span class="label">{{ folder.name }}</span>
|
||||
@@ -107,13 +107,13 @@ export default {
|
||||
computed: {
|
||||
...mapGetters(['user', 'homeDirectory', 'currentFolder', 'config', 'fileInfoDetail']),
|
||||
favourites() {
|
||||
return this.user.relationships.favourites.data.attributes.folders
|
||||
return this.user.data.relationships.favourites.data.attributes.folders
|
||||
},
|
||||
tree() {
|
||||
return this.user.relationships.tree.data.attributes.folders
|
||||
return this.user.data.attributes.folders
|
||||
},
|
||||
storage() {
|
||||
return this.$store.getters.user.relationships.storage.data.attributes
|
||||
return this.$store.getters.user.data.attributes.storage
|
||||
}
|
||||
},
|
||||
data() {
|
||||
@@ -154,7 +154,7 @@ export default {
|
||||
if (this.draggedItem && this.draggedItem.type !== 'folder') return
|
||||
|
||||
// Check if folder exist in favourites
|
||||
if (this.favourites.find(folder => folder.unique_id == this.draggedItem.unique_id)) return
|
||||
if (this.favourites.find(folder => folder.id == this.draggedItem.id)) return
|
||||
|
||||
// Prevent to move folders to self
|
||||
if (this.fileInfoDetail.length > 0 && this.fileInfoDetail.find(item => item.type !== 'folder')) return
|
||||
|
||||
Reference in New Issue
Block a user